<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Chapter 4 MySQL Programs</title>
<link rel="stylesheet" href="mvl.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets + chunker.py v1.9.2" />
<link rel="start" href="index.html" title="{book-title}" />
<link rel="up" href="" title="" />
<link rel="prev" href="tutorial.html" title="Chapter 3 Tutorial" />
<link rel="next" href="server-administration.html" title="Chapter 5 MySQL Server Administration" />
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 4 MySQL Programs</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="tutorial.html">Prev</a> </td>
<th width="60%" align="center"></th>
<td width="20%" align="right"> <a accesskey="n" href="server-administration.html">Next</a></td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage">
<div>
<div>
<h1 class="title"><a name="programs"></a>Chapter 4 MySQL Programs</h1>

</div>

</div>

</div>
<div class="toc">
<p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="programs.html#programs-overview">4.1 Overview of MySQL Programs</a></span></dt><dt><span class="section"><a href="programs.html#programs-using">4.2 Using MySQL Programs</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#invoking-programs">4.2.1 Invoking MySQL Programs</a></span></dt><dt><span class="section"><a href="programs.html#program-options">4.2.2 Specifying Program Options</a></span></dt><dt><span class="section"><a href="programs.html#connection-options">4.2.3 Command Options for Connecting to the Server</a></span></dt><dt><span class="section"><a href="programs.html#connecting">4.2.4 Connecting to the MySQL Server Using Command Options</a></span></dt><dt><span class="section"><a href="programs.html#connecting-using-uri-or-key-value-pairs">4.2.5 Connecting to the Server Using URI-Like Strings or Key-Value Pairs</a></span></dt><dt><span class="section"><a href="programs.html#connection-compression-control">4.2.6 Connection Compression Control</a></span></dt><dt><span class="section"><a href="programs.html#setting-environment-variables">4.2.7 Setting Environment Variables</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#programs-server">4.3 Server and Server-Startup Programs</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#mysqld">4.3.1 <span class="command"><strong>mysqld</strong></span> — The MySQL Server</a></span></dt><dt><span class="section"><a href="programs.html#mysqld-safe">4.3.2 <span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script</a></span></dt><dt><span class="section"><a href="programs.html#mysql-server">4.3.3 <span class="command"><strong>mysql.server</strong></span> — MySQL Server Startup Script</a></span></dt><dt><span class="section"><a href="programs.html#mysqld-multi">4.3.4 <span class="command"><strong>mysqld_multi</strong></span> — Manage Multiple MySQL Servers</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#programs-installation">4.4 Installation-Related Programs</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#comp-err">4.4.1 <span class="command"><strong>comp_err</strong></span> — Compile MySQL Error Message File</a></span></dt><dt><span class="section"><a href="programs.html#mysql-secure-installation">4.4.2 <span class="command"><strong>mysql_secure_installation</strong></span> — Improve MySQL Installation Security</a></span></dt><dt><span class="section"><a href="programs.html#mysql-ssl-rsa-setup">4.4.3 <span class="command"><strong>mysql_ssl_rsa_setup</strong></span> — Create SSL/RSA Files</a></span></dt><dt><span class="section"><a href="programs.html#mysql-tzinfo-to-sql">4.4.4 <span class="command"><strong>mysql_tzinfo_to_sql</strong></span> — Load the Time Zone Tables</a></span></dt><dt><span class="section"><a href="programs.html#mysql-upgrade">4.4.5 <span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#programs-client">4.5 Client Programs</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#mysql">4.5.1 <span class="command"><strong>mysql</strong></span> — The MySQL Command-Line Client</a></span></dt><dt><span class="section"><a href="programs.html#mysqladmin">4.5.2 <span class="command"><strong>mysqladmin</strong></span> — Client for Administering a MySQL Server</a></span></dt><dt><span class="section"><a href="programs.html#mysqlcheck">4.5.3 <span class="command"><strong>mysqlcheck</strong></span> — A Table Maintenance Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqldump">4.5.4 <span class="command"><strong>mysqldump</strong></span> — A Database Backup Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqlimport">4.5.5 <span class="command"><strong>mysqlimport</strong></span> — A Data Import Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqlpump">4.5.6 <span class="command"><strong>mysqlpump</strong></span> — A Database Backup Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqlshow">4.5.7 <span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information</a></span></dt><dt><span class="section"><a href="programs.html#mysqlslap">4.5.8 <span class="command"><strong>mysqlslap</strong></span> — Load Emulation Client</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#programs-admin-utils">4.6 Administrative and Utility Programs</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#ibd2sdi">4.6.1 <span class="command"><strong>ibd2sdi</strong></span> — InnoDB Tablespace SDI Extraction Utility</a></span></dt><dt><span class="section"><a href="programs.html#innochecksum">4.6.2 <span class="command"><strong>innochecksum</strong></span> — Offline InnoDB File Checksum Utility</a></span></dt><dt><span class="section"><a href="programs.html#myisam-ftdump">4.6.3 <span class="command"><strong>myisam_ftdump</strong></span> — Display Full-Text Index information</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk">4.6.4 <span class="command"><strong>myisamchk</strong></span> — MyISAM Table-Maintenance Utility</a></span></dt><dt><span class="section"><a href="programs.html#myisamlog">4.6.5 <span class="command"><strong>myisamlog</strong></span> — Display MyISAM Log File Contents</a></span></dt><dt><span class="section"><a href="programs.html#myisampack">4.6.6 <span class="command"><strong>myisampack</strong></span> — Generate Compressed, Read-Only MyISAM Tables</a></span></dt><dt><span class="section"><a href="programs.html#mysql-config-editor">4.6.7 <span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility</a></span></dt><dt><span class="section"><a href="programs.html#mysqlbinlog">4.6.8 <span class="command"><strong>mysqlbinlog</strong></span> — Utility for Processing Binary Log Files</a></span></dt><dt><span class="section"><a href="programs.html#mysqldumpslow">4.6.9 <span class="command"><strong>mysqldumpslow</strong></span> — Summarize Slow Query Log Files</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#programs-development">4.7 Program Development Utilities</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#mysql-config">4.7.1 <span class="command"><strong>mysql_config</strong></span> — Display Options for Compiling Clients</a></span></dt><dt><span class="section"><a href="programs.html#my-print-defaults">4.7.2 <span class="command"><strong>my_print_defaults</strong></span> — Display Options from Option Files</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#programs-miscellaneous">4.8 Miscellaneous Programs</a></span></dt><dd><dl><dt><span class="section"><a href="programs.html#lz4-decompress">4.8.1 <span class="command"><strong>lz4_decompress</strong></span> — Decompress mysqlpump LZ4-Compressed Output</a></span></dt><dt><span class="section"><a href="programs.html#perror">4.8.2 <span class="command"><strong>perror</strong></span> — Display MySQL Error Message Information</a></span></dt><dt><span class="section"><a href="programs.html#zlib-decompress">4.8.3 <span class="command"><strong>zlib_decompress</strong></span> — Decompress mysqlpump ZLIB-Compressed Output</a></span></dt></dl></dd><dt><span class="section"><a href="programs.html#environment-variables">4.9 Environment Variables</a></span></dt><dt><span class="section"><a href="programs.html#unix-signal-response">4.10 Unix Signal Handling in MySQL</a></span></dt></dl>
</div>
<p>
    This chapter provides a brief overview of the MySQL command-line
    programs provided by Oracle Corporation. It also discusses the
    general syntax for specifying options when you run these programs.
    Most programs have options that are specific to their own operation,
    but the option syntax is similar for all of them. Finally, the
    chapter provides more detailed descriptions of individual programs,
    including which options they recognize.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-overview"></a>4.1 Overview of MySQL Programs</h2>
</div>
</div>
</div>
<p>
      There are many different programs in a MySQL installation. This
      section provides a brief overview of them. Later sections provide
      a more detailed description of each one, with the exception of NDB
      Cluster programs. Each program's description indicates its
      invocation syntax and the options that it supports.
      <a class="xref" href="mysql-cluster.html#mysql-cluster-programs" title="22.4 NDB Cluster Programs">Section 22.4, “NDB Cluster Programs”</a>, describes programs
      specific to NDB Cluster.
    </p><p>
      Most MySQL distributions include all of these programs, except for
      those programs that are platform-specific. (For example, the
      server startup scripts are not used on Windows.) The exception is
      that RPM distributions are more specialized. There is one RPM for
      the server, another for client programs, and so forth. If you
      appear to be missing one or more programs, see
      <a class="xref" href="installing.html" title="Chapter 2 Installing and Upgrading MySQL">Chapter 2, <i>Installing and Upgrading MySQL</i></a>, for information on types of
      distributions and what they contain. It may be that you have a
      distribution that does not include all programs and you need to
      install an additional package.
    </p><p>
      Each MySQL program takes many different options. Most programs
      provide a <code class="option">--help</code> option that you can use to get a
      description of the program's different options. For example, try
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql --help</strong></span></a>.
    </p><p>
      You can override default option values for MySQL programs by
      specifying options on the command line or in an option file. See
      <a class="xref" href="programs.html#programs-using" title="4.2 Using MySQL Programs">Section 4.2, “Using MySQL Programs”</a>, for general information on
      invoking programs and specifying program options.
    </p><p>
      The MySQL server, <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, is the main program
      that does most of the work in a MySQL installation. The server is
      accompanied by several related scripts that assist you in starting
      and stopping the server:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="indexterm" name="idm46444434895856"></a>

          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
        </p><p>
          The SQL daemon (that is, the MySQL server). To use client
          programs, <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> must be running, because
          clients gain access to databases by connecting to the server.
          See <a class="xref" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server">Section 4.3.1, “<span class="command"><strong>mysqld</strong></span> — The MySQL Server”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434890320"></a>

          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>
        </p><p>
          A server startup script. <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>
          attempts to start <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. See
          <a class="xref" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script">Section 4.3.2, “<span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434883696"></a>

          <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a>
        </p><p>
          A server startup script. This script is used on systems that
          use System V-style run directories containing scripts that
          start system services for particular run levels. It invokes
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> to start the MySQL server. See
          <a class="xref" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script">Section 4.3.3, “<span class="command"><strong>mysql.server</strong></span> — MySQL Server Startup Script”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434878096"></a>

          <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a>
        </p><p>
          A server startup script that can start or stop multiple
          servers installed on the system. See
          <a class="xref" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers">Section 4.3.4, “<span class="command"><strong>mysqld_multi</strong></span> — Manage Multiple MySQL Servers”</a>.
</p></li></ul>
</div>
<p>
      Several programs perform setup operations during MySQL
      installation or upgrading:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="indexterm" name="idm46444434872976"></a>

          <a class="link" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File"><span class="command"><strong>comp_err</strong></span></a>
        </p><p>
          This program is used during the MySQL build/installation
          process. It compiles error message files from the error source
          files. See <a class="xref" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File">Section 4.4.1, “<span class="command"><strong>comp_err</strong></span> — Compile MySQL Error Message File”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434868528"></a>

          <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a>
        </p><p>
          This program enables you to improve the security of your MySQL
          installation. See <a class="xref" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security">Section 4.4.2, “<span class="command"><strong>mysql_secure_installation</strong></span> — Improve MySQL Installation Security”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434864176"></a>

          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a>
        </p><p>
          This program creates the SSL certificate and key files and RSA
          key-pair files required to support secure connections, if
          those files are missing. Files created by
          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> can be used for secure
          connections using SSL or RSA. See
          <a class="xref" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files">Section 4.4.3, “<span class="command"><strong>mysql_ssl_rsa_setup</strong></span> — Create SSL/RSA Files”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434858608"></a>

          <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a>
        </p><p>
          This program loads the time zone tables in the
          <code class="literal">mysql</code> database using the contents of the
          host system <span class="firstterm">zoneinfo</span>
          database (the set of files describing time zones). See
          <a class="xref" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables">Section 4.4.4, “<span class="command"><strong>mysql_tzinfo_to_sql</strong></span> — Load the Time Zone Tables”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434852704"></a>

          <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>
        </p><p>
          This program is used after a MySQL upgrade operation. It
          updates the grant tables with any changes that have been made
          in newer versions of MySQL, and checks tables for
          incompatibilities and repairs them if necessary. See
          <a class="xref" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables">Section 4.4.5, “<span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables”</a>.
</p></li></ul>
</div>
<p>
      MySQL client programs that connect to the MySQL server:
</p><a class="indexterm" name="idm46444434848240"></a><a class="indexterm" name="idm46444434847168"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="indexterm" name="idm46444434844912"></a>

          <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
        </p><p>
          The command-line tool for interactively entering SQL
          statements or executing them from a file in batch mode. See
          <a class="xref" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client">Section 4.5.1, “<span class="command"><strong>mysql</strong></span> — The MySQL Command-Line Client”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434840656"></a>

          <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>
        </p><p>
          A client that performs administrative operations, such as
          creating or dropping databases, reloading the grant tables,
          flushing tables to disk, and reopening log files.
          <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> can also be used to retrieve
          version, process, and status information from the server. See
          <a class="xref" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server">Section 4.5.2, “<span class="command"><strong>mysqladmin</strong></span> — Client for Administering a MySQL Server”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434835008"></a>

          <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a>
        </p><p>
          A table-maintenance client that checks, repairs, analyzes, and
          optimizes tables. See <a class="xref" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program">Section 4.5.3, “<span class="command"><strong>mysqlcheck</strong></span> — A Table Maintenance Program”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434830784"></a>

          <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>
        </p><p>
          A client that dumps a MySQL database into a file as SQL, text,
          or XML. See <a class="xref" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program">Section 4.5.4, “<span class="command"><strong>mysqldump</strong></span> — A Database Backup Program”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434826576"></a>

          <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a>
        </p><p>
          A client that imports text files into their respective tables
          using <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>. See
          <a class="xref" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program">Section 4.5.5, “<span class="command"><strong>mysqlimport</strong></span> — A Data Import Program”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434821136"></a>

          <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>
        </p><p>
          A client that dumps a MySQL database into a file as SQL. See
          <a class="xref" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program">Section 4.5.6, “<span class="command"><strong>mysqlpump</strong></span> — A Database Backup Program”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434816944"></a>

          <span class="command"><strong>mysqlsh</strong></span>
        </p><p>
          MySQL Shell is an advanced client and code editor for MySQL
          Server. See <a class="ulink" href="https://dev.mysql.com/doc/mysql-shell/8.0/en/" target="_top">MySQL Shell 8.0 (part of MySQL 8.0)</a>. In addition to the
          provided SQL functionality, similar to
          <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, MySQL Shell provides scripting
          capabilities for JavaScript and Python and includes APIs for
          working with MySQL. X DevAPI enables you to work with both
          relational and document data, see
          <a class="xref" href="document-store.html" title="Chapter 20 Using MySQL as a Document Store">Chapter 20, <i>Using MySQL as a Document Store</i></a>. AdminAPI enables you to
          work with InnoDB cluster, see
          <a class="xref" href="mysql-innodb-cluster-userguide.html" title="Chapter 21 InnoDB Cluster">Chapter 21, <i>InnoDB Cluster</i></a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434810160"></a>

          <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>
        </p><p>
          A client that displays information about databases, tables,
          columns, and indexes. See <a class="xref" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information">Section 4.5.7, “<span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434805984"></a>

          <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a>
        </p><p>
          A client that is designed to emulate client load for a MySQL
          server and report the timing of each stage. It works as if
          multiple clients are accessing the server. See
          <a class="xref" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client">Section 4.5.8, “<span class="command"><strong>mysqlslap</strong></span> — Load Emulation Client”</a>.
</p></li></ul>
</div>
<p>
      MySQL administrative and utility programs:
</p><a class="indexterm" name="idm46444434801488"></a><a class="indexterm" name="idm46444434800416"></a><a class="indexterm" name="idm46444434798928"></a><a class="indexterm" name="idm46444434797856"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="indexterm" name="idm46444434795600"></a>

          <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a>
        </p><p>
          An offline <code class="literal">InnoDB</code> offline file checksum
          utility. See <a class="xref" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility">Section 4.6.2, “<span class="command"><strong>innochecksum</strong></span> — Offline InnoDB File Checksum Utility”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434790592"></a>

          <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a>
        </p><p>
          A utility that displays information about full-text indexes in
          <code class="literal">MyISAM</code> tables. See
          <a class="xref" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information">Section 4.6.3, “<span class="command"><strong>myisam_ftdump</strong></span> — Display Full-Text Index information”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434785552"></a>

          <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>
        </p><p>
          A utility to describe, check, optimize, and repair
          <code class="literal">MyISAM</code> tables. See
          <a class="xref" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility">Section 4.6.4, “<span class="command"><strong>myisamchk</strong></span> — MyISAM Table-Maintenance Utility”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434780640"></a>

          <a class="link" href="programs.html#myisamlog" title="4.6.5 myisamlog — Display MyISAM Log File Contents"><span class="command"><strong>myisamlog</strong></span></a>
        </p><p>
          A utility that processes the contents of a
          <code class="literal">MyISAM</code> log file. See
          <a class="xref" href="programs.html#myisamlog" title="4.6.5 myisamlog — Display MyISAM Log File Contents">Section 4.6.5, “<span class="command"><strong>myisamlog</strong></span> — Display MyISAM Log File Contents”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434775616"></a>

          <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>
        </p><p>
          A utility that compresses <code class="literal">MyISAM</code> tables to
          produce smaller read-only tables. See
          <a class="xref" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables">Section 4.6.6, “<span class="command"><strong>myisampack</strong></span> — Generate Compressed, Read-Only MyISAM Tables”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434770528"></a>

          <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a>
        </p><p>
          A utility that enables you to store authentication credentials
          in a secure, encrypted login path file named
          <code class="filename">.mylogin.cnf</code>. See
          <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434765376"></a>

          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>
        </p><p>
          A utility for reading statements from a binary log. The log of
          executed statements contained in the binary log files can be
          used to help recover from a crash. See
          <a class="xref" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files">Section 4.6.8, “<span class="command"><strong>mysqlbinlog</strong></span> — Utility for Processing Binary Log Files”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434760880"></a>

          <a class="link" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files"><span class="command"><strong>mysqldumpslow</strong></span></a>
        </p><p>
          A utility to read and summarize the contents of a slow query
          log. See <a class="xref" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files">Section 4.6.9, “<span class="command"><strong>mysqldumpslow</strong></span> — Summarize Slow Query Log Files”</a>.
</p></li></ul>
</div>
<p>
      MySQL program-development utilities:
</p><a class="indexterm" name="idm46444434756432"></a><a class="indexterm" name="idm46444434755344"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a>
        </p><p>
          A shell script that produces the option values needed when
          compiling MySQL programs. See <a class="xref" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients">Section 4.7.1, “<span class="command"><strong>mysql_config</strong></span> — Display Options for Compiling Clients”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434749936"></a>

          <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a>
        </p><p>
          A utility that shows which options are present in option
          groups of option files. See
          <a class="xref" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files">Section 4.7.2, “<span class="command"><strong>my_print_defaults</strong></span> — Display Options from Option Files”</a>.
</p></li></ul>
</div>
<p>
      Miscellaneous utilities:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          <a class="indexterm" name="idm46444434744784"></a>

          <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a>
        </p><p>
          A utility that decompresses <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>
          output that was created using LZ4 compression. See
          <a class="xref" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output">Section 4.8.1, “<span class="command"><strong>lz4_decompress</strong></span> — Decompress mysqlpump LZ4-Compressed Output”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434739344"></a>

          <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a>
        </p><p>
          A utility that displays the meaning of system or MySQL error
          codes. See <a class="xref" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information">Section 4.8.2, “<span class="command"><strong>perror</strong></span> — Display MySQL Error Message Information”</a>.
        </p></li><li class="listitem"><p>
          <a class="indexterm" name="idm46444434735136"></a>

          <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a>
        </p><p>
          A utility that decompresses <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>
          output that was created using ZLIB compression. See
          <a class="xref" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output">Section 4.8.3, “<span class="command"><strong>zlib_decompress</strong></span> — Decompress mysqlpump ZLIB-Compressed Output”</a>.
</p></li></ul>
</div>
<p>
      Oracle Corporation also provides the
      <a class="link" href="workbench.html" title="Chapter 31 MySQL Workbench">MySQL Workbench</a> GUI tool, which
      is used to administer MySQL servers and databases, to create,
      execute, and evaluate queries, and to migrate schemas and data
      from other relational database management systems for use with
      MySQL. Additional GUI tools include
      <a class="ulink" href="https://dev.mysql.com/doc/mysql-notifier/en/mysql-notifier-overview.html" target="_top">MySQL Notifier</a> and
      <a class="ulink" href="https://dev.mysql.com/doc/mysql-for-excel/en/" target="_top">MySQL for Excel</a>.
    </p><a class="indexterm" name="idm46444434727008"></a><a class="indexterm" name="idm46444434725936"></a><p>
      MySQL client programs that communicate with the server using the
      MySQL client/server library use the following environment
      variables.
</p><a class="indexterm" name="idm46444434723888"></a><a class="indexterm" name="idm46444434722800"></a><a class="indexterm" name="idm46444434721312"></a><a class="indexterm" name="idm46444434720224"></a><a class="indexterm" name="idm46444434718736"></a><a class="indexterm" name="idm46444434717648"></a><a class="indexterm" name="idm46444434716160"></a><a class="indexterm" name="idm46444434715072"></a>
<div class="informaltable">
<table summary="Environment variables used by MySQL client programs that communicate with the server using the MySQL client/server library."><col width="25%"><col width="75%"><thead><tr>
          <th scope="col">Environment Variable</th>
          <th scope="col">Meaning</th>
        </tr></thead><tbody><tr>
          <td scope="row"><code class="literal">MYSQL_UNIX_PORT</code></td>
          <td>The default Unix socket file; used for connections to
            <code class="literal">localhost</code></td>
        </tr><tr>
          <td scope="row"><code class="literal">MYSQL_TCP_PORT</code></td>
          <td>The default port number; used for TCP/IP connections</td>
        </tr><tr>
          <td scope="row"><code class="literal">MYSQL_DEBUG</code></td>
          <td>Debug trace options when debugging</td>
        </tr><tr>
          <td scope="row"><code class="literal">TMPDIR</code></td>
          <td>The directory where temporary tables and files are created</td>
</tr></tbody></table>
</div>
<p>
      For a full list of environment variables used by MySQL programs,
      see <a class="xref" href="programs.html#environment-variables" title="4.9 Environment Variables">Section 4.9, “Environment Variables”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-using"></a>4.2 Using MySQL Programs</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#invoking-programs">4.2.1 Invoking MySQL Programs</a></span></dt><dt><span class="section"><a href="programs.html#program-options">4.2.2 Specifying Program Options</a></span></dt><dt><span class="section"><a href="programs.html#connection-options">4.2.3 Command Options for Connecting to the Server</a></span></dt><dt><span class="section"><a href="programs.html#connecting">4.2.4 Connecting to the MySQL Server Using Command Options</a></span></dt><dt><span class="section"><a href="programs.html#connecting-using-uri-or-key-value-pairs">4.2.5 Connecting to the Server Using URI-Like Strings or Key-Value Pairs</a></span></dt><dt><span class="section"><a href="programs.html#connection-compression-control">4.2.6 Connection Compression Control</a></span></dt><dt><span class="section"><a href="programs.html#setting-environment-variables">4.2.7 Setting Environment Variables</a></span></dt></dl>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="invoking-programs"></a>4.2.1 Invoking MySQL Programs</h3>

</div>

</div>

</div>
<p>
      To invoke a MySQL program from the command line (that is, from
      your shell or command prompt), enter the program name followed by
      any options or other arguments needed to instruct the program what
      you want it to do. The following commands show some sample program
      invocations. <code class="literal">shell&gt;</code> represents the prompt
      for your command interpreter; it is not part of what you type. The
      particular prompt you see depends on your command interpreter.
      Typical prompts are <code class="literal">$</code> for
      <span class="command"><strong>sh</strong></span>, <span class="command"><strong>ksh</strong></span>, or
      <span class="command"><strong>bash</strong></span>, <code class="literal">%</code> for
      <span class="command"><strong>csh</strong></span> or <span class="command"><strong>tcsh</strong></span>, and
      <code class="literal">C:\&gt;</code> for the Windows
      <span class="command"><strong>command.com</strong></span> or <span class="command"><strong>cmd.exe</strong></span>
      command interpreters.
    </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --user=root test</code></strong>
shell&gt; <strong class="userinput"><code>mysqladmin extended-status variables</code></strong>
shell&gt; <strong class="userinput"><code>mysqlshow --help</code></strong>
shell&gt; <strong class="userinput"><code>mysqldump -u root personnel</code></strong>
</pre><p>
      Arguments that begin with a single or double dash
      (<code class="literal">-</code>, <code class="literal">--</code>) specify program
      options. Options typically indicate the type of connection a
      program should make to the server or affect its operational mode.
      Option syntax is described in <a class="xref" href="programs.html#program-options" title="4.2.2 Specifying Program Options">Section 4.2.2, “Specifying Program Options”</a>.
    </p><p>
      Nonoption arguments (arguments with no leading dash) provide
      additional information to the program. For example, the
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> program interprets the first nonoption
      argument as a database name, so the command <code class="literal">mysql
      --user=root test</code> indicates that you want to use the
      <code class="literal">test</code> database.
    </p><p>
      Later sections that describe individual programs indicate which
      options a program supports and describe the meaning of any
      additional nonoption arguments.
    </p><p>
      Some options are common to a number of programs. The most
      frequently used of these are the
      <a class="link" href="programs.html#option_general_host"><code class="option">--host</code></a> (or <code class="option">-h</code>),
      <a class="link" href="programs.html#option_general_user"><code class="option">--user</code></a> (or <code class="option">-u</code>),
      and <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a> (or
      <code class="option">-p</code>) options that specify connection parameters.
      They indicate the host where the MySQL server is running, and the
      user name and password of your MySQL account. All MySQL client
      programs understand these options; they enable you to specify
      which server to connect to and the account to use on that server.
      Other connection options are
      <a class="link" href="programs.html#option_general_port"><code class="option">--port</code></a> (or <code class="option">-P</code>) to
      specify a TCP/IP port number and
      <a class="link" href="programs.html#option_general_socket"><code class="option">--socket</code></a> (or <code class="option">-S</code>)
      to specify a Unix socket file on Unix (or named-pipe name on
      Windows). For more information on options that specify connection
      options, see <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
    </p><a class="indexterm" name="idm46444434664320"></a><a class="indexterm" name="idm46444434663232"></a><p>
      You may find it necessary to invoke MySQL programs using the path
      name to the <code class="filename">bin</code> directory in which they are
      installed. This is likely to be the case if you get a
      <span class="quote">“<span class="quote">program not found</span>”</span> error whenever you attempt to run
      a MySQL program from any directory other than the
      <code class="filename">bin</code> directory. To make it more convenient to
      use MySQL, you can add the path name of the
      <code class="filename">bin</code> directory to your <code class="literal">PATH</code>
      environment variable setting. That enables you to run a program by
      typing only its name, not its entire path name. For example, if
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is installed in
      <code class="filename">/usr/local/mysql/bin</code>, you can run the program
      by invoking it as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, and it is not
      necessary to invoke it as
      <span class="command"><strong>/usr/local/mysql/bin/mysql</strong></span>.
    </p><p>
      Consult the documentation for your command interpreter for
      instructions on setting your <code class="literal">PATH</code> variable. The
      syntax for setting environment variables is interpreter-specific.
      (Some information is given in
      <a class="xref" href="programs.html#setting-environment-variables" title="4.2.7 Setting Environment Variables">Section 4.2.7, “Setting Environment Variables”</a>.) After modifying
      your <code class="literal">PATH</code> setting, open a new console window on
      Windows or log in again on Unix so that the setting goes into
      effect.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="program-options"></a>4.2.2 Specifying Program Options</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#command-line-options">4.2.2.1 Using Options on the Command Line</a></span></dt><dt><span class="section"><a href="programs.html#option-files">4.2.2.2 Using Option Files</a></span></dt><dt><span class="section"><a href="programs.html#option-file-options">4.2.2.3 Command-Line Options that Affect Option-File Handling</a></span></dt><dt><span class="section"><a href="programs.html#option-modifiers">4.2.2.4 Program Option Modifiers</a></span></dt><dt><span class="section"><a href="programs.html#program-variables">4.2.2.5 Using Options to Set Program Variables</a></span></dt><dt><span class="section"><a href="programs.html#option-defaults-equals">4.2.2.6 Option Defaults, Options Expecting Values, and the = Sign</a></span></dt></dl>
</div>
<p>
      There are several ways to specify options for MySQL programs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          List the options on the command line following the program
          name. This is common for options that apply to a specific
          invocation of the program.
        </p></li><li class="listitem"><p>
          List the options in an option file that the program reads when
          it starts. This is common for options that you want the
          program to use each time it runs.
        </p></li><li class="listitem"><p>
          List the options in environment variables (see
          <a class="xref" href="programs.html#setting-environment-variables" title="4.2.7 Setting Environment Variables">Section 4.2.7, “Setting Environment Variables”</a>). This method
          is useful for options that you want to apply each time the
          program runs. In practice, option files are used more commonly
          for this purpose, but <a class="xref" href="server-administration.html#multiple-unix-servers" title="5.8.3 Running Multiple MySQL Instances on Unix">Section 5.8.3, “Running Multiple MySQL Instances on Unix”</a>,
          discusses one situation in which environment variables can be
          very helpful. It describes a handy technique that uses such
          variables to specify the TCP/IP port number and Unix socket
          file for the server and for client programs.
</p></li></ul>
</div>
<p>
      Options are processed in order, so if an option is specified
      multiple times, the last occurrence takes precedence. The
      following command causes <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to connect to
      the server running on <code class="literal">localhost</code>:
    </p><pre data-lang="terminal" class="programlisting">mysql -h example.com -h localhost</pre><p>
      There is one exception: For <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, the
      <span class="emphasis"><em>first</em></span> instance of the
      <a class="link" href="server-administration.html#option_mysqld_user"><code class="option">--user</code></a> option is used as a security
      precaution, to prevent a user specified in an option file from
      being overridden on the command line.
    </p><p>
      If conflicting or related options are given, later options take
      precedence over earlier options. The following command runs
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> in <span class="quote">“<span class="quote">no column names</span>”</span> mode:
    </p><pre data-lang="terminal" class="programlisting">mysql --column-names --skip-column-names</pre><a class="indexterm" name="idm46444434634080"></a><a class="indexterm" name="idm46444434632592"></a><p>
      MySQL programs determine which options are given first by
      examining environment variables, then by processing option files,
      and then by checking the command line. Because later options take
      precedence over earlier ones, the processing order means that
      environment variables have the lowest precedence and command-line
      options the highest.
    </p><a class="indexterm" name="idm46444434630336"></a><a class="indexterm" name="idm46444434629248"></a><p>
      For the server, one exception applies: The
      <span class="command"><strong>mysqld-auto.cnf</strong></span> option file in the data
      directory is processed last, so it takes precedence even over
      command-line options.
    </p><p>
      You can take advantage of the way that MySQL programs process
      options by specifying default option values for a program in an
      option file. That enables you to avoid typing them each time you
      run the program while enabling you to override the defaults if
      necessary by using command-line options.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="command-line-options"></a>4.2.2.1 Using Options on the Command Line</h4>
</div>
</div>
</div>
<p>
        Program options specified on the command line follow these
        rules:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Options are given after the command name.
          </p></li><li class="listitem"><p>
            An option argument begins with one dash or two dashes,
            depending on whether it is a short form or long form of the
            option name. Many options have both short and long forms.
            For example, <code class="option">-?</code> and <code class="option">--help</code>
            are the short and long forms of the option that instructs a
            MySQL program to display its help message.
          </p></li><li class="listitem"><p>
            Option names are case-sensitive. <code class="option">-v</code> and
            <code class="option">-V</code> are both legal and have different
            meanings. (They are the corresponding short forms of the
            <code class="option">--verbose</code> and <code class="option">--version</code>
            options.)
          </p></li><li class="listitem"><p>
            Some options take a value following the option name. For
            example, <code class="option">-h localhost</code> or
            <a class="link" href="programs.html#option_general_host"><code class="option">--host=localhost</code></a> indicate
            the MySQL server host to a client program. The option value
            tells the program the name of the host where the MySQL
            server is running.
          </p></li><li class="listitem"><p>
            For a long option that takes a value, separate the option
            name and the value by an <code class="literal">=</code> sign. For a
            short option that takes a value, the option value can
            immediately follow the option letter, or there can be a
            space between: <code class="option">-hlocalhost</code> and <code class="option">-h
            localhost</code> are equivalent. An exception to this rule
            is the option for specifying your MySQL password. This
            option can be given in long form as
            <a class="link" href="programs.html#option_general_password"><code class="option">--password=<em class="replaceable"><code>pass_val</code></em></code></a>
            or as <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a>. In the
            latter case (with no password value given), the program
            interactively prompts you for the password. The password
            option also may be given in short form as
            <code class="option">-p<em class="replaceable"><code>pass_val</code></em></code> or as
            <code class="option">-p</code>. However, for the short form, if the
            password value is given, it must follow the option letter
            with <span class="emphasis"><em>no intervening space</em></span>: If a space
            follows the option letter, the program has no way to tell
            whether a following argument is supposed to be the password
            value or some other kind of argument. Consequently, the
            following two commands have two completely different
            meanings:
          </p><pre data-lang="terminal" class="programlisting">mysql -ptest
mysql -p test</pre><p>
            The first command instructs <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to use
            a password value of <code class="literal">test</code>, but specifies
            no default database. The second instructs
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to prompt for the password value
            and to use <code class="literal">test</code> as the default database.
          </p></li><li class="listitem"><p>
            Within option names, dash (<code class="literal">-</code>) and
            underscore (<code class="literal">_</code>) may be used
            interchangeably. For example,
            <a class="link" href="server-administration.html#option_mysqld_skip-grant-tables"><code class="option">--skip-grant-tables</code></a> and
            <a class="link" href="server-administration.html#option_mysqld_skip-grant-tables"><code class="option">--skip_grant_tables</code></a>
            are equivalent. (However, the leading dashes cannot be given
            as underscores.)
          </p></li><li class="listitem"><p>
            The MySQL server has certain command options that may be
            specified only at startup, and a set of system variables,
            some of which may be set at startup, at runtime, or both.
            System variable names use underscores rather than dashes,
            and when referenced at runtime (for example, using
            <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET</code></a>
            or <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> statements), must
            be written using underscores:
          </p><pre data-lang="sql" class="programlisting">SET GLOBAL general_log = ON;
SELECT @@GLOBAL.general_log;</pre><p>
            At server startup, the syntax for system variables is the
            same as for command options, so within variable names,
            dashes and underscores may be used interchangeably. For
            example, <a class="link" href="server-administration.html#sysvar_general_log"><code class="option">--general_log=ON</code></a> and
            <a class="link" href="server-administration.html#sysvar_general_log"><code class="option">--general-log=ON</code></a> are
            equivalent. (This is also true for system variables set
            within option files.)
          </p></li><li class="listitem"><p>
            For options that take a numeric value, the value can be
            given with a suffix of <code class="literal">K</code>,
            <code class="literal">M</code>, or <code class="literal">G</code> to indicate a
            multiplier of 1024, 1024<sup>2</sup> or
            1024<sup>3</sup>. As of MySQL 8.0.14, a
            suffix can also be <code class="literal">T</code>,
            <code class="literal">P</code>, and <code class="literal">E</code> to indicate a
            multiplier of 1024<sup>4</sup>,
            1024<sup>5</sup> or
            1024<sup>6</sup>. Suffix letters can be
            uppercase or lowercase.
          </p><p>
            For example, the following command tells
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> to ping the server 1024 times,
            sleeping 10 seconds between each ping:
          </p><pre data-lang="terminal" class="programlisting">mysqladmin --count=1K --sleep=10 ping</pre></li><li class="listitem"><p>
            When specifying file names as option values, avoid the use
            of the <code class="literal">~</code> shell metacharacter. It might
            not be interpreted as you expect.
</p></li></ul>
</div>
<p>
        Option values that contain spaces must be quoted when given on
        the command line. For example, the
        <a class="link" href="programs.html#option_mysql_execute"><code class="option">--execute</code></a> (or <code class="option">-e</code>)
        option can be used with <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to pass one or
        more semicolon-separated SQL statements to the server. When this
        option is used, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> executes the statements
        in the option value and exits. The statements must be enclosed
        by quotation marks. For example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql -u root -p -e "SELECT VERSION();SELECT NOW()"</code></strong>
Enter password: <strong class="userinput"><code>******</code></strong>
+------------+
| VERSION()  |
+------------+
| 8.0.19     |
+------------+
+---------------------+
| NOW()               |
+---------------------+
| 2019-09-03 10:36:48 |
+---------------------+
shell&gt;
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The long form (<a class="link" href="programs.html#option_mysql_execute"><code class="option">--execute</code></a>) is
          followed by an equal sign (<code class="literal">=</code>).
</p>
</div>
<p>
        To use quoted values within a statement, you must either escape
        the inner quotation marks, or use a different type of quotation
        marks within the statement from those used to quote the
        statement itself. The capabilities of your command processor
        dictate your choices for whether you can use single or double
        quotation marks and the syntax for escaping quote characters.
        For example, if your command processor supports quoting with
        single or double quotation marks, you can use double quotation
        marks around the statement, and single quotation marks for any
        quoted values within the statement.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="option-files"></a>4.2.2.2 Using Option Files</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444434567584"></a><a class="indexterm" name="idm46444434566512"></a><a class="indexterm" name="idm46444434565440"></a><a class="indexterm" name="idm46444434563952"></a><a class="indexterm" name="idm46444434562464"></a><a class="indexterm" name="idm46444434561392"></a><a class="indexterm" name="idm46444434559904"></a><a class="indexterm" name="idm46444434558816"></a><a class="indexterm" name="idm46444434557328"></a><a class="indexterm" name="idm46444434556240"></a><p>
        Most MySQL programs can read startup options from option files
        (sometimes called configuration files). Option files provide a
        convenient way to specify commonly used options so that they
        need not be entered on the command line each time you run a
        program.
      </p><p>
        To determine whether a program reads option files, invoke it
        with the <code class="option">--help</code> option. (For
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, use
        <a class="link" href="server-administration.html#option_mysqld_verbose"><code class="option">--verbose</code></a> and
        <a class="link" href="server-administration.html#option_mysqld_help"><code class="option">--help</code></a>.) If the program reads
        option files, the help message indicates which files it looks
        for and which option groups it recognizes.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          A MySQL program started with the
          <code class="option">--no-defaults</code> option reads no option files
          other than <code class="filename">.mylogin.cnf</code>.
        </p><p>
          A server started with the
          <a class="link" href="server-administration.html#sysvar_persisted_globals_load"><code class="literal">persisted_globals_load</code></a> system
          variable disabled does not read
          <code class="filename">mysqld-auto.cnf</code>.
</p>
</div>
<p>
        Many option files are plain text files, created using any text
        editor. The exceptions are:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The <code class="filename">.mylogin.cnf</code> file that contains
            login path options. This is an encrypted file created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>. A <span class="quote">“<span class="quote">login
            path</span>”</span> is an option group that permits only certain
            options: <code class="option">host</code>, <code class="option">user</code>,
            <code class="option">password</code>, <code class="option">port</code> and
            <code class="option">socket</code>. Client programs specify which login
            path to read from <code class="filename">.mylogin.cnf</code> using
            the <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path</code></a> option.
          </p><p>
            To specify an alternative login path file name, set the
            <code class="literal">MYSQL_TEST_LOGIN_FILE</code> environment
            variable. This variable is used by the
            <span class="command"><strong>mysql-test-run.pl</strong></span> testing utility, but
            also is recognized by <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a>
            and by MySQL clients such as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>,
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>, and so forth.
          </p></li><li class="listitem"><p>
            The <code class="filename">mysqld-auto.cnf</code> file in the data
            directory. This JSON-format file contains persisted system
            variable settings. It is created by the server upon
            execution of
            <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
            PERSIST</code></a> or
            <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
            PERSIST_ONLY</code></a> statements. See
            <a class="xref" href="server-administration.html#persisted-system-variables" title="5.1.9.3 Persisted System Variables">Section 5.1.9.3, “Persisted System Variables”</a>. Management of
            <code class="filename">mysqld-auto.cnf</code> should be left to the
            server and not performed manually.
</p></li></ul>
</div>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#option-file-order" title="Option File Processing Order">Option File Processing Order</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#option-file-syntax" title="Option File Syntax">Option File Syntax</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#option-file-inclusions" title="Option File Inclusions">Option File Inclusions</a></p></li></ul>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="option-file-order"></a>Option File Processing Order</h5>

</div>

</div>

</div>
<p>
          MySQL looks for option files in the order described in the
          following discussion and reads any that exist. If an option
          file you want to use does not exist, create it using the
          appropriate method, as just discussed.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            For information about option files used with NDB Cluster
            programs, see <a class="xref" href="mysql-cluster.html#mysql-cluster-configuration" title="22.3 Configuration of NDB Cluster">Section 22.3, “Configuration of NDB Cluster”</a>.
</p>
</div>
<p>
          On Windows, MySQL programs read startup options from the files
          shown in the following table, in the specified order (files
          listed first are read first, files read later take
          precedence).
</p>
<div class="table">
<a name="option-files-windows"></a><p class="title"><b>Table 4.1 Option Files Read on Windows Systems</b></p>
<div class="table-contents">
<table summary="Option files read by MySQL programs on Windows systems."><col width="30%"><col width="70%"><thead><tr>
              <th scope="col">File Name</th>
              <th scope="col">Purpose</th>
            </tr></thead><tbody><tr>
              <td scope="row"><code class="filename"><code class="literal">%WINDIR%</code>\my.ini</code>,
                <code class="filename"><code class="literal">%WINDIR%</code>\my.cnf</code></td>
              <td>Global options</td>
            </tr><tr>
              <td scope="row"><code class="filename">C:\my.ini</code>, <code class="filename">C:\my.cnf</code></td>
              <td>Global options</td>
            </tr><tr>
              <td scope="row"><code class="filename"><em class="replaceable"><code>BASEDIR</code></em>\my.ini</code>,
                <code class="filename"><em class="replaceable"><code>BASEDIR</code></em>\my.cnf</code></td>
              <td>Global options</td>
            </tr><tr>
              <td scope="row"><code class="literal">defaults-extra-file</code></td>
              <td>The file specified with
                <a class="link" href="programs.html#option_general_defaults-extra-file"><code class="option">--defaults-extra-file</code></a>,
                if any</td>
            </tr><tr>
              <td scope="row"><code class="filename"><code class="literal">%APPDATA%</code>\MySQL\.mylogin.cnf</code></td>
              <td>Login path options (clients only)</td>
            </tr><tr>
              <td scope="row"><code class="filename"><em class="replaceable"><code>DATADIR</code></em>\mysqld-auto.cnf</code></td>
              <td>System variables persisted with
                <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
                PERSIST</code></a> or
                <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
                PERSIST_ONLY</code></a> (server only)</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
          In the preceding table, <code class="literal">%WINDIR%</code> represents
          the location of your Windows directory. This is commonly
          <code class="filename">C:\WINDOWS</code>. Use the following command to
          determine its exact location from the value of the
          <code class="literal">WINDIR</code> environment variable:
        </p><pre data-lang="terminal" class="programlisting">C:\&gt; <strong class="userinput"><code>echo %WINDIR%</code></strong>
</pre><p>
          <code class="literal">%APPDATA%</code> represents the value of the
          Windows application data directory. Use the following command
          to determine its exact location from the value of the
          <code class="literal">APPDATA</code> environment variable:
        </p><pre data-lang="terminal" class="programlisting">C:\&gt; <strong class="userinput"><code>echo %APPDATA%</code></strong>
</pre><p>
          <em class="replaceable"><code>BASEDIR</code></em> represents the MySQL base
          installation directory. When MySQL 8.0 has been
          installed using MySQL Installer, this is typically
          <code class="filename">C:\<em class="replaceable"><code>PROGRAMDIR</code></em>\MySQL\MySQL
          8.0 Server</code> where
          <em class="replaceable"><code>PROGRAMDIR</code></em> represents the programs
          directory (usually <code class="filename">Program Files</code> on
          English-language versions of Windows), See
          <a class="xref" href="installing.html#mysql-installer" title="2.3.3 MySQL Installer for Windows">Section 2.3.3, “MySQL Installer for Windows”</a>.
        </p><p>
          <em class="replaceable"><code>DATADIR</code></em> represents the MySQL data
          directory. As used to find
          <code class="filename">mysqld-auto.cnf</code>, its default value is the
          data directory location built in when MySQL was compiled, but
          can be changed by <a class="link" href="server-administration.html#sysvar_datadir"><code class="option">--datadir</code></a>
          specified as an option-file or command-line option processed
          before <code class="filename">mysqld-auto.cnf</code> is processed.
        </p><p>
          On Unix and Unix-like systems, MySQL programs read startup
          options from the files shown in the following table, in the
          specified order (files listed first are read first, files read
          later take precedence).
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            On Unix platforms, MySQL ignores configuration files that
            are world-writable. This is intentional as a security
            measure.
</p>
</div>
<a class="indexterm" name="idm46444434468272"></a><a class="indexterm" name="idm46444434467200"></a>
<div class="table">
<a name="option-files-unix"></a><p class="title"><b>Table 4.2 Option Files Read on Unix and Unix-Like Systems</b></p>
<div class="table-contents">
<table summary="Option files read by MySQL programs on Unix and Unix-like systems."><col width="30%"><col width="70%"><thead><tr>
              <th scope="col">File Name</th>
              <th scope="col">Purpose</th>
            </tr></thead><tbody><tr>
              <td scope="row"><code class="filename">/etc/my.cnf</code></td>
              <td>Global options</td>
            </tr><tr>
              <td scope="row"><code class="filename">/etc/mysql/my.cnf</code></td>
              <td>Global options</td>
            </tr><tr>
              <td scope="row"><code class="filename"><em class="replaceable"><code>SYSCONFDIR</code></em>/my.cnf</code></td>
              <td>Global options</td>
            </tr><tr>
              <td scope="row"><code class="filename">$MYSQL_HOME/my.cnf</code></td>
              <td>Server-specific options (server only)</td>
            </tr><tr>
              <td scope="row"><code class="literal">defaults-extra-file</code></td>
              <td>The file specified with
                <a class="link" href="programs.html#option_general_defaults-extra-file"><code class="option">--defaults-extra-file</code></a>,
                if any</td>
            </tr><tr>
              <td scope="row"><code class="filename">~/.my.cnf</code></td>
              <td>User-specific options</td>
            </tr><tr>
              <td scope="row"><code class="filename">~/.mylogin.cnf</code></td>
              <td>User-specific login path options (clients only)</td>
            </tr><tr>
              <td scope="row"><code class="filename"><em class="replaceable"><code>DATADIR</code></em>/mysqld-auto.cnf</code></td>
              <td>System variables persisted with
                <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
                PERSIST</code></a> or
                <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SE
                PERSIST_ONLY</code></a> (server only)</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break"><p>
          In the preceding table, <code class="filename">~</code> represents the
          current user's home directory (the value of
          <code class="literal">$HOME</code>).
        </p><p>
          <em class="replaceable"><code>SYSCONFDIR</code></em> represents the directory
          specified with the <a class="link" href="installing.html#option_cmake_sysconfdir"><code class="option">SYSCONFDIR</code></a>
          option to <span class="command"><strong>CMake</strong></span> when MySQL was built. By
          default, this is the <code class="filename">etc</code> directory
          located under the compiled-in installation directory.
        </p><p>
          <code class="literal">MYSQL_HOME</code> is an environment variable
          containing the path to the directory in which the
          server-specific <code class="filename">my.cnf</code> file resides. If
          <code class="literal">MYSQL_HOME</code> is not set and you start the
          server using the <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> program,
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> sets it to
          <em class="replaceable"><code>BASEDIR</code></em>, the MySQL base
          installation directory.
        </p><p>
          <em class="replaceable"><code>DATADIR</code></em> represents the MySQL data
          directory. As used to find
          <code class="filename">mysqld-auto.cnf</code>, its default value is the
          data directory location built in when MySQL was compiled, but
          can be changed by <a class="link" href="server-administration.html#sysvar_datadir"><code class="option">--datadir</code></a>
          specified as an option-file or command-line option processed
          before <code class="filename">mysqld-auto.cnf</code> is processed.
        </p><p>
          If multiple instances of a given option are found, the last
          instance takes precedence, with one exception: For
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, the <span class="emphasis"><em>first</em></span>
          instance of the <a class="link" href="server-administration.html#option_mysqld_user"><code class="option">--user</code></a> option
          is used as a security precaution, to prevent a user specified
          in an option file from being overridden on the command line.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="option-file-syntax"></a>Option File Syntax</h5>

</div>

</div>

</div>
<p>
          The following description of option file syntax applies to
          files that you edit manually. This excludes
          <code class="filename">.mylogin.cnf</code>, which is created using
          <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> and is encrypted, and
          <code class="filename">mysqld-auto.cnf</code>, which the server creates
          in JSON format.
        </p><p>
          Any long option that may be given on the command line when
          running a MySQL program can be given in an option file as
          well. To get the list of available options for a program, run
          it with the <code class="option">--help</code> option. (For
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, use
          <a class="link" href="server-administration.html#option_mysqld_verbose"><code class="option">--verbose</code></a> and
          <a class="link" href="server-administration.html#option_mysqld_help"><code class="option">--help</code></a>.)
        </p><p>
          The syntax for specifying options in an option file is similar
          to command-line syntax (see
          <a class="xref" href="programs.html#command-line-options" title="4.2.2.1 Using Options on the Command Line">Section 4.2.2.1, “Using Options on the Command Line”</a>). However, in an option
          file, you omit the leading two dashes from the option name and
          you specify only one option per line. For example,
          <code class="option">--quick</code> and <code class="option">--host=localhost</code>
          on the command line should be specified as
          <code class="literal">quick</code> and <code class="literal">host=localhost</code>
          on separate lines in an option file. To specify an option of
          the form
          <code class="option">--loose-<em class="replaceable"><code>opt_name</code></em></code>
          in an option file, write it as
          <code class="literal">loose-<em class="replaceable"><code>opt_name</code></em></code>.
        </p><p>
          Empty lines in option files are ignored. Nonempty lines can
          take any of the following forms:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              <code class="literal">#<em class="replaceable"><code>comment</code></em></code>,
              <code class="literal">;<em class="replaceable"><code>comment</code></em></code>
            </p><p>
              Comment lines start with <code class="literal">#</code> or
              <code class="literal">;</code>. A <code class="literal">#</code> comment can
              start in the middle of a line as well.
            </p></li><li class="listitem"><p>
              <code class="literal">[<em class="replaceable"><code>group</code></em>]</code>
            </p><p>
              <em class="replaceable"><code>group</code></em> is the name of the
              program or group for which you want to set options. After
              a group line, any option-setting lines apply to the named
              group until the end of the option file or another group
              line is given. Option group names are not case-sensitive.
            </p></li><li class="listitem"><p>
              <code class="literal"><em class="replaceable"><code>opt_name</code></em></code>
            </p><p>
              This is equivalent to
              <code class="option">--<em class="replaceable"><code>opt_name</code></em></code> on
              the command line.
            </p></li><li class="listitem"><p>
              <code class="literal"><em class="replaceable"><code>opt_name</code></em>=<em class="replaceable"><code>value</code></em></code>
            </p><p>
              This is equivalent to
              <code class="option">--<em class="replaceable"><code>opt_name</code></em>=<em class="replaceable"><code>value</code></em></code>
              on the command line. In an option file, you can have
              spaces around the <code class="literal">=</code> character,
              something that is not true on the command line. The value
              optionally can be enclosed within single quotation marks
              or double quotation marks, which is useful if the value
              contains a <code class="literal">#</code> comment character.
</p></li></ul>
</div>
<p>
          Leading and trailing spaces are automatically deleted from
          option names and values.
        </p><a class="indexterm" name="idm46444434382528"></a><a class="indexterm" name="idm46444434381040"></a><p>
          You can use the escape sequences <code class="literal">\b</code>,
          <code class="literal">\t</code>, <code class="literal">\n</code>,
          <code class="literal">\r</code>, <code class="literal">\\</code>, and
          <code class="literal">\s</code> in option values to represent the
          backspace, tab, newline, carriage return, backslash, and space
          characters. In option files, these escaping rules apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
              A backslash followed by a valid escape sequence character
              is converted to the character represented by the sequence.
              For example, <code class="literal">\s</code> is converted to a
              space.
            </p></li><li class="listitem"><p>
              A backslash not followed by a valid escape sequence
              character remains unchanged. For example,
              <code class="literal">\S</code> is retained as is.
</p></li></ul>
</div>
<p>
          The preceding rules mean that a literal backslash can be given
          as <code class="literal">\\</code>, or as <code class="literal">\</code> if it is
          not followed by a valid escape sequence character.
        </p><p>
          The rules for escape sequences in option files differ slightly
          from the rules for escape sequences in string literals in SQL
          statements. In the latter context, if
          <span class="quote">“<span class="quote"><em class="replaceable"><code>x</code></em></span>”</span> is not a valid
          escape sequence character,
          <code class="literal">\<em class="replaceable"><code>x</code></em></code> becomes
          <span class="quote">“<span class="quote"><em class="replaceable"><code>x</code></em></span>”</span> rather than
          <code class="literal">\<em class="replaceable"><code>x</code></em></code>. See
          <a class="xref" href="language-structure.html#string-literals" title="9.1.1 String Literals">Section 9.1.1, “String Literals”</a>.
        </p><a class="indexterm" name="idm46444434364544"></a><a class="indexterm" name="idm46444434363056"></a><p>
          The escaping rules for option file values are especially
          pertinent for Windows path names, which use
          <code class="literal">\</code> as a path name separator. A separator in
          a Windows path name must be written as <code class="literal">\\</code>
          if it is followed by an escape sequence character. It can be
          written as <code class="literal">\\</code> or <code class="literal">\</code> if it
          is not. Alternatively, <code class="literal">/</code> may be used in
          Windows path names and will be treated as
          <code class="literal">\</code>. Suppose that you want to specify a base
          directory of <code class="filename">C:\Program Files\MySQL\MySQL Server
          8.0</code> in an option file. This can be
          done several ways. Some examples:
        </p><pre data-lang="ini" class="programlisting">basedir="C:\Program Files\MySQL\MySQL Server 8.0"
basedir="C:\\Program Files\\MySQL\\MySQL Server 8.0"
basedir="C:/Program Files/MySQL/MySQL Server 8.0"
basedir=C:\\Program\sFiles\\MySQL\\MySQL\sServer\s8.0</pre><p>
          If an option group name is the same as a program name, options
          in the group apply specifically to that program. For example,
          the <code class="literal">[mysqld]</code> and <code class="literal">[mysql]</code>
          groups apply to the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server and the
          <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client program, respectively.
        </p><p>
          The <code class="literal">[client]</code> option group is read by all
          client programs provided in MySQL distributions (but
          <span class="emphasis"><em>not</em></span> by <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>). To
          understand how third-party client programs that use the C API
          can use option files, see the C API documentation at
          <a class="xref" href="connectors-apis.html#mysql-options" title="28.7.6.50 mysql_options()">Section 28.7.6.50, “mysql_options()”</a>.
        </p><p>
          The <code class="literal">[client]</code> group enables you to specify
          options that apply to all clients. For example,
          <code class="literal">[client]</code> is the appropriate group to use to
          specify the password for connecting to the server. (But make
          sure that the option file is accessible only by yourself, so
          that other people cannot discover your password.) Be sure not
          to put an option in the <code class="literal">[client]</code> group
          unless it is recognized by <span class="emphasis"><em>all</em></span> client
          programs that you use. Programs that do not understand the
          option quit after displaying an error message if you try to
          run them.
        </p><p>
          List more general option groups first and more specific groups
          later. For example, a <code class="literal">[client]</code> group is
          more general because it is read by all client programs,
          whereas a <code class="literal">[mysqldump]</code> group is read only by
          <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>. Options specified later override
          options specified earlier, so putting the option groups in the
          order <code class="literal">[client]</code>,
          <code class="literal">[mysqldump]</code> enables
          <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>-specific options to override
          <code class="literal">[client]</code> options.
        </p><p>
          Here is a typical global option file:
        </p><pre data-lang="ini" class="programlisting">[client]
port=3306
socket=/tmp/mysql.sock

[mysqld]
port=3306
socket=/tmp/mysql.sock
key_buffer_size=16M
max_allowed_packet=128M

[mysqldump]
quick</pre><p>
          Here is a typical user option file:
        </p><pre data-lang="ini" class="programlisting">[client]
# The following password will be sent to all standard MySQL clients
password="my password"

[mysql]
no-auto-rehash
connect_timeout=2</pre><p>
          To create option groups to be read only by
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> servers from specific MySQL release
          series, use groups with names of
          <code class="literal">[mysqld-5.7]</code>,
          <code class="literal">[mysqld-8.0]</code>, and so forth.
          The following group indicates that the
          <a class="link" href="server-administration.html#sysvar_sql_mode"><code class="literal">sql_mode</code></a> setting should be
          used only by MySQL servers with 8.0.x version
          numbers:
        </p><pre data-lang="ini" class="programlisting">[mysqld-8.0]
sql_mode=TRADITIONAL</pre>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h5 class="title"><a name="option-file-inclusions"></a>Option File Inclusions</h5>

</div>

</div>

</div>
<p>
          It is possible to use <code class="literal">!include</code> directives
          in option files to include other option files and
          <code class="literal">!includedir</code> to search specific directories
          for option files. For example, to include the
          <code class="filename">/home/mydir/myopt.cnf</code> file, use the
          following directive:
        </p><pre data-lang="ini" class="programlisting">!include /home/mydir/myopt.cnf</pre><p>
          To search the <code class="filename">/home/mydir</code> directory and
          read option files found there, use this directive:
        </p><pre data-lang="ini" class="programlisting">!includedir /home/mydir</pre><p>
          MySQL makes no guarantee about the order in which option files
          in the directory are read.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
            Any files to be found and included using the
            <code class="literal">!includedir</code> directive on Unix operating
            systems <span class="emphasis"><em>must</em></span> have file names ending in
            <code class="filename">.cnf</code>. On Windows, this directive checks
            for files with the <code class="filename">.ini</code> or
            <code class="filename">.cnf</code> extension.
</p>
</div>
<p>
          Write the contents of an included option file like any other
          option file. That is, it should contain groups of options,
          each preceded by a
          <code class="literal">[<em class="replaceable"><code>group</code></em>]</code> line
          that indicates the program to which the options apply.
        </p><p>
          While an included file is being processed, only those options
          in groups that the current program is looking for are used.
          Other groups are ignored. Suppose that a
          <code class="filename">my.cnf</code> file contains this line:
        </p><pre data-lang="ini" class="programlisting">!include /home/mydir/myopt.cnf</pre><p>
          And suppose that <code class="filename">/home/mydir/myopt.cnf</code>
          looks like this:
        </p><pre data-lang="ini" class="programlisting">[mysqladmin]
force

[mysqld]
key_buffer_size=16M</pre><p>
          If <code class="filename">my.cnf</code> is processed by
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, only the
          <code class="literal">[mysqld]</code> group in
          <code class="filename">/home/mydir/myopt.cnf</code> is used. If the
          file is processed by <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>, only the
          <code class="literal">[mysqladmin]</code> group is used. If the file is
          processed by any other program, no options in
          <code class="filename">/home/mydir/myopt.cnf</code> are used.
        </p><p>
          The <code class="literal">!includedir</code> directive is processed
          similarly except that all option files in the named directory
          are read.
        </p><p>
          If an option file contains <code class="literal">!include</code> or
          <code class="literal">!includedir</code> directives, files named by
          those directives are processed whenever the option file is
          processed, no matter where they appear in the file.
        </p><p>
          For inclusion directives to work, the file path should not be
          specified within quotes and should have no escape sequences.
          For example, the following statements provided in
          <code class="filename">my.ini</code> will read the option file
          <code class="filename">myopts.ini</code>:
        </p><pre data-lang="ini" class="programlisting">!include C:/ProgramData/MySQL/MySQL Server/myopts.ini
!include C:\ProgramData\MySQL\MySQL Server\myopts.ini
!include C:\\ProgramData\\MySQL\\MySQL Server\\myopts.ini</pre><p>
          On Windows, if <code class="literal">!include
          <em class="replaceable"><code>/path/to/extra.ini</code></em></code> is the
          last line in the file, make sure that a newline is appended at
          the end or the line will be ignored.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="option-file-options"></a>4.2.2.3 Command-Line Options that Affect Option-File Handling</h4>

</div>

</div>

</div>
<p>
        Most MySQL programs that support option files handle the
        following options. Because these options affect option-file
        handling, they must be given on the command line and not in an
        option file. To work properly, each of these options must be
        given before other options, with these exceptions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#option_general_print-defaults"><code class="option">--print-defaults</code></a> may be used
            immediately after
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>,
            <a class="link" href="programs.html#option_general_defaults-extra-file"><code class="option">--defaults-extra-file</code></a>, or
            <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path</code></a>.
          </p></li><li class="listitem"><p>
            On Windows, if the server is started with the
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a> and
            <a class="link" href="server-administration.html#option_mysqld_install"><code class="option">--install</code></a> options,
            <a class="link" href="server-administration.html#option_mysqld_install"><code class="option">--install</code></a> must be first. See
            <a class="xref" href="installing.html#windows-start-service" title="2.3.4.8 Starting MySQL as a Windows Service">Section 2.3.4.8, “Starting MySQL as a Windows Service”</a>.
</p></li></ul>
</div>
<p>
        When specifying file names as option values, avoid the use of
        the <code class="literal">~</code> shell metacharacter because it might
        not be interpreted as you expect.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_general_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444434279936"></a>

            <a class="link" href="programs.html#option_general_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file and (on all platforms)
            before the login path file. (For information about the order
            in which option files are used, see
            <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.) If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            See the introduction to this section regarding constraints
            on the position in which this option may be specified.
          </p></li><li class="listitem"><p><a name="option_general_defaults-file"></a>
            <a class="indexterm" name="idm46444434273824"></a>

            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exceptions: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>,
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> reads
            <code class="filename">mysqld-auto.cnf</code> and client programs
            read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            See the introduction to this section regarding constraints
            on the position in which this option may be specified.
          </p></li><li class="listitem"><p><a name="option_general_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444434264432"></a>

            <a class="link" href="programs.html#option_general_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example, the
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client normally reads the
            <code class="literal">[client]</code> and <code class="literal">[mysql]</code>
            groups. If the
            <a class="link" href="programs.html#option_general_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysql_other]</code> groups.
          </p></li><li class="listitem"><p><a name="option_general_login-path"></a>
            <a class="indexterm" name="idm46444434253360"></a>

            <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            A client program reads the option group corresponding to the
            named login path, in addition to option groups that the
            program reads by default. Consider this command:
          </p><pre data-lang="terminal" class="programlisting">mysql --login-path=mypath</pre><p>
            By default, the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client reads the
            <code class="literal">[client]</code> and <code class="literal">[mysql]</code>
            option groups. So for the command shown,
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> reads <code class="literal">[client]</code>
            and <code class="literal">[mysql]</code> from other option files, and
            <code class="literal">[client]</code>, <code class="literal">[mysql]</code>, and
            <code class="literal">[mypath]</code> from the login path file.
          </p><p>
            Client programs read the login path file even when the
            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a> option is
            used.
          </p><a class="indexterm" name="idm46444434235984"></a><a class="indexterm" name="idm46444434234880"></a><p>
            To specify an alternate login path file name, set the
            <code class="literal">MYSQL_TEST_LOGIN_FILE</code> environment
            variable.
          </p><p>
            See the introduction to this section regarding constraints
            on the position in which this option may be specified.
          </p></li><li class="listitem"><p><a name="option_general_no-defaults"></a>
            <a class="indexterm" name="idm46444434230464"></a>

            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a> can be used to
            prevent them from being read.
          </p><p>
            The exception is that client programs read the
            <code class="filename">.mylogin.cnf</code> login path file, if it
            exists, even when
            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a> is used. This
            permits passwords to be specified in a safer way than on the
            command line even if
            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a> is present.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p></li><li class="listitem"><p><a name="option_general_print-defaults"></a>
            <a class="indexterm" name="idm46444434219600"></a>

            <a class="link" href="programs.html#option_general_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files. Password values are masked.
          </p><p>
            See the introduction to this section regarding constraints
            on the position in which this option may be specified.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="option-modifiers"></a>4.2.2.4 Program Option Modifiers</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444434214896"></a><a class="indexterm" name="idm46444434213440"></a><a class="indexterm" name="idm46444434212096"></a><a class="indexterm" name="idm46444434210608"></a><a class="indexterm" name="idm46444434209264"></a><a class="indexterm" name="idm46444434207776"></a><a class="indexterm" name="idm46444434206432"></a><a class="indexterm" name="idm46444434204944"></a><a class="indexterm" name="idm46444434203600"></a><a class="indexterm" name="idm46444434202112"></a><a class="indexterm" name="idm46444434200768"></a><a class="indexterm" name="idm46444434199280"></a><p>
        Some options are <span class="quote">“<span class="quote">boolean</span>”</span> and control behavior
        that can be turned on or off. For example, the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client supports a
        <a class="link" href="programs.html#option_mysql_column-names"><code class="option">--column-names</code></a> option that
        determines whether or not to display a row of column names at
        the beginning of query results. By default, this option is
        enabled. However, you may want to disable it in some instances,
        such as when sending the output of <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> into
        another program that expects to see only data and not an initial
        header line.
      </p><p>
        To disable column names, you can specify the option using any of
        these forms:
      </p><pre data-lang="terminal" class="programlisting">--disable-column-names
--skip-column-names
--column-names=0</pre><p>
        The <code class="option">--disable</code> and <code class="option">--skip</code>
        prefixes and the <code class="literal">=0</code> suffix all have the same
        effect: They turn the option off.
      </p><p>
        The <span class="quote">“<span class="quote">enabled</span>”</span> form of the option may be specified
        in any of these ways:
      </p><pre data-lang="terminal" class="programlisting">--column-names
--enable-column-names
--column-names=1</pre><p>
        The values <code class="literal">ON</code>, <code class="literal">TRUE</code>,
        <code class="literal">OFF</code>, and <code class="literal">FALSE</code> are also
        recognized for boolean options (not case-sensitive).
      </p><p>
        If an option is prefixed by <code class="option">--loose</code>, a program
        does not exit with an error if it does not recognize the option,
        but instead issues only a warning:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --loose-no-such-option</code></strong>
mysql: WARNING: unknown option '--loose-no-such-option'
</pre><p>
        The <code class="option">--loose</code> prefix can be useful when you run
        programs from multiple installations of MySQL on the same
        machine and list options in an option file. An option that may
        not be recognized by all versions of a program can be given
        using the <code class="option">--loose</code> prefix (or
        <code class="literal">loose</code> in an option file). Versions of the
        program that recognize the option process it normally, and
        versions that do not recognize it issue a warning and ignore it.
      </p><p>
        The <code class="option">--maximum</code> prefix is available for
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> only and permits a limit to be placed
        on how large client programs can set session system variables.
        To do this, use a <code class="option">--maximum</code> prefix with the
        variable name. For example,
        <code class="option">--maximum-max_heap_table_size=32M</code> prevents any
        client from making the heap table size limit larger than 32M.
      </p><p>
        The <code class="option">--maximum</code> prefix is intended for use with
        system variables that have a session value. If applied to a
        system variable that has only a global value, an error occurs.
        For example, with <code class="option">--maximum-back_log=200</code>, the
        server produces this error:
</p><pre data-lang="none" class="programlisting">Maximum value of 'back_log' cannot be set</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="program-variables"></a>4.2.2.5 Using Options to Set Program Variables</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444434172320"></a><a class="indexterm" name="idm46444434170864"></a><p>
        Many MySQL programs have internal variables that can be set at
        runtime using the
        <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET</code></a>
        statement. See <a class="xref" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment">Section 13.7.6.1, “SET Syntax for Variable Assignment”</a>, and
        <a class="xref" href="server-administration.html#using-system-variables" title="5.1.9 Using System Variables">Section 5.1.9, “Using System Variables”</a>.
      </p><p>
        Most of these program variables also can be set at server
        startup by using the same syntax that applies to specifying
        program options. For example, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> has a
        <code class="literal">max_allowed_packet</code> variable that controls the
        maximum size of its communication buffer. To set the
        <code class="literal">max_allowed_packet</code> variable for
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to a value of 16MB, use either of the
        following commands:
      </p><pre data-lang="terminal" class="programlisting">mysql --max_allowed_packet=16777216
mysql --max_allowed_packet=16M</pre><p>
        The first command specifies the value in bytes. The second
        specifies the value in megabytes. For variables that take a
        numeric value, the value can be given with a suffix of
        <code class="literal">K</code>, <code class="literal">M</code>, or
        <code class="literal">G</code> to indicate a multiplier of 1024,
        1024<sup>2</sup> or
        1024<sup>3</sup>. (For example, when used to set
        <code class="literal">max_allowed_packet</code>, the suffixes indicate
        units of kilobytes, megabytes, or gigabytes.) As of MySQL
        8.0.14, a suffix can also be <code class="literal">T</code>,
        <code class="literal">P</code>, and <code class="literal">E</code> to indicate a
        multiplier of 1024<sup>4</sup>,
        1024<sup>5</sup> or
        1024<sup>6</sup>. Suffix letters can be
        uppercase or lowercase.
      </p><p>
        In an option file, variable settings are given without the
        leading dashes:
      </p><pre data-lang="ini" class="programlisting">[mysql]
max_allowed_packet=16777216</pre><p>
        Or:
      </p><pre data-lang="ini" class="programlisting">[mysql]
max_allowed_packet=16M</pre><p>
        If you like, underscores in a variable name can be specified as
        dashes. The following option groups are equivalent. Both set the
        size of the server's key buffer to 512MB:
      </p><pre data-lang="ini" class="programlisting">[mysqld]
key_buffer_size=512M

[mysqld]
key-buffer-size=512M</pre><p>
        A variable can be specified by writing it in full or as any
        unambiguous prefix. For example, the
        <code class="literal">max_allowed_packet</code> variable can be set for
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> as <code class="option">--max_a</code>, but not as
        <code class="option">--max</code> because the latter is ambiguous:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --max=1000000</code></strong>
mysql: ambiguous option '--max=1000000' (max_allowed_packet, max_join_size)
</pre><p>
        Be aware that the use of variable prefixes can cause problems in
        the event that new variables are implemented for a program. A
        prefix that is unambiguous now might become ambiguous in the
        future.
      </p><p>
        Suffixes for specifying a value multiplier can be used when
        setting a variable at program invocation time, but not to set
        the value with
        <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET</code></a> at
        runtime. On the other hand, with
        <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET</code></a>, you
        can assign a variable's value using an expression, which is not
        true when you set a variable at server startup. For example, the
        first of the following lines is legal at program invocation
        time, but the second is not:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --max_allowed_packet=16M</code></strong>
shell&gt; <strong class="userinput"><code>mysql --max_allowed_packet=16*1024*1024</code></strong>
</pre><p>
        Conversely, the second of the following lines is legal at
        runtime, but the first is not:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>SET GLOBAL max_allowed_packet=16M;</code></strong>
mysql&gt; <strong class="userinput"><code>SET GLOBAL max_allowed_packet=16*1024*1024;</code></strong>
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="option-defaults-equals"></a>4.2.2.6 Option Defaults, Options Expecting Values, and the = Sign</h4>

</div>

</div>

</div>
<p>
        By convention, long forms of options that assign a value are
        written with an equals (<code class="literal">=</code>) sign, like this:
      </p><pre data-lang="terminal" class="programlisting">mysql --host=tonfisk --user=jon</pre><p>
        For options that require a value (that is, not having a default
        value), the equal sign is not required, and so the following is
        also valid:
      </p><pre data-lang="terminal" class="programlisting">mysql --host tonfisk --user jon</pre><p>
        In both cases, the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client attempts to
        connect to a MySQL server running on the host named
        <span class="quote">“<span class="quote">tonfisk</span>”</span> using an account with the user name
        <span class="quote">“<span class="quote">jon</span>”</span>.
      </p><p>
        Due to this behavior, problems can occasionally arise when no
        value is provided for an option that expects one. Consider the
        following example, where a user connects to a MySQL server
        running on host <code class="literal">tonfisk</code> as user
        <code class="literal">jon</code>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --host 85.224.35.45 --user jon</code></strong>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 8.0.22 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; <strong class="userinput"><code>SELECT CURRENT_USER();</code></strong>
+----------------+
| CURRENT_USER() |
+----------------+
| jon@%          |
+----------------+
1 row in set (0.00 sec)
</pre><p>
        Omitting the required value for one of these option yields an
        error, such as the one shown here:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --host 85.224.35.45 --user</code></strong>
<span class="errortext">mysql: option '--user' requires an argument</span>
</pre><p>
        In this case, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> was unable to find a
        value following the <a class="link" href="programs.html#option_general_user"><code class="option">--user</code></a>
        option because nothing came after it on the command line.
        However, if you omit the value for an option that is
        <span class="emphasis"><em>not</em></span> the last option to be used, you obtain
        a different error that you may not be expecting:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --host --user jon</code></strong>
<span class="errortext">ERROR 2005 (HY000): Unknown MySQL server host '--user' (1)</span>
</pre><p>
        Because <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> assumes that any string
        following <a class="link" href="programs.html#option_general_host"><code class="option">--host</code></a> on the command
        line is a host name, <a class="link" href="programs.html#option_general_host"><code class="option">--host</code></a>
        <a class="link" href="programs.html#option_general_user"><code class="option">--user</code></a> is interpreted as
        <a class="link" href="programs.html#option_general_host"><code class="option">--host=--user</code></a>, and the client
        attempts to connect to a MySQL server running on a host named
        <span class="quote">“<span class="quote">--user</span>”</span>.
      </p><p>
        Options having default values always require an equal sign when
        assigning a value; failing to do so causes an error. For
        example, the MySQL server
        <a class="link" href="server-administration.html#option_mysqld_log-error"><code class="option">--log-error</code></a> option has the
        default value
        <code class="filename"><em class="replaceable"><code>host_name</code></em>.err</code>,
        where <em class="replaceable"><code>host_name</code></em> is the name of the
        host on which MySQL is running. Assume that you are running
        MySQL on a computer whose host name is <span class="quote">“<span class="quote">tonfisk</span>”</span>,
        and consider the following invocation of
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_safe &amp;</code></strong>
[1] 11699
shell&gt; 080112 12:53:40 mysqld_safe Logging to '/usr/local/mysql/var/tonfisk.err'.
080112 12:53:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
shell&gt;
</pre><p>
        After shutting down the server, restart it as follows:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_safe --log-error &amp;</code></strong>
[1] 11699
shell&gt; 080112 12:53:40 mysqld_safe Logging to '/usr/local/mysql/var/tonfisk.err'.
080112 12:53:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
shell&gt;
</pre><p>
        The result is the same, since
        <a class="link" href="programs.html#option_mysqld_safe_log-error"><code class="option">--log-error</code></a> is not followed
        by anything else on the command line, and it supplies its own
        default value. (The <code class="literal">&amp;</code> character tells the
        operating system to run MySQL in the background; it is ignored
        by MySQL itself.) Now suppose that you wish to log errors to a
        file named <code class="filename">my-errors.err</code>. You might try
        starting the server with <code class="option">--log-error my-errors</code>,
        but this does not have the intended effect, as shown here:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_safe --log-error my-errors &amp;</code></strong>
[1] 31357
shell&gt; 080111 22:53:31 mysqld_safe Logging to '/usr/local/mysql/var/tonfisk.err'.
080111 22:53:32 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var
080111 22:53:34 mysqld_safe mysqld from pid file /usr/local/mysql/var/tonfisk.pid ended

[1]+  Done                    ./mysqld_safe --log-error my-errors
</pre><p>
        The server attempted to start using
        <code class="filename">/usr/local/mysql/var/tonfisk.err</code> as the
        error log, but then shut down. Examining the last few lines of
        this file shows the reason:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>tail /usr/local/mysql/var/tonfisk.err</code></strong>
2013-09-24T15:36:22.278034Z 0 [ERROR] Too many arguments (first extra is 'my-errors').
2013-09-24T15:36:22.278059Z 0 [Note] Use --verbose --help to get a list of available options!
2013-09-24T15:36:22.278076Z 0 [ERROR] Aborting
2013-09-24T15:36:22.279704Z 0 [Note] InnoDB: Starting shutdown...
2013-09-24T15:36:23.777471Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2319086
2013-09-24T15:36:23.780134Z 0 [Note] mysqld: Shutdown complete
</pre><p>
        Because the <a class="link" href="programs.html#option_mysqld_safe_log-error"><code class="option">--log-error</code></a>
        option supplies a default value, you must use an equal sign to
        assign a different value to it, as shown here:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_safe --log-error=my-errors &amp;</code></strong>
[1] 31437
shell&gt; 080111 22:54:15 mysqld_safe Logging to '/usr/local/mysql/var/my-errors.err'.
080111 22:54:15 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/var

shell&gt;
</pre><p>
        Now the server has been started successfully, and is logging
        errors to the file
        <code class="filename">/usr/local/mysql/var/my-errors.err</code>.
      </p><p>
        Similar issues can arise when specifying option values in option
        files. For example, consider a <code class="filename">my.cnf</code> file
        that contains the following:
      </p><pre data-lang="ini" class="programlisting">[mysql]

host
user</pre><p>
        When the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client reads this file, these
        entries are parsed as <a class="link" href="programs.html#option_mysql_host"><code class="option">--host</code></a>
        <a class="link" href="programs.html#option_mysql_user"><code class="option">--user</code></a> or
        <a class="link" href="programs.html#option_mysql_host"><code class="option">--host=--user</code></a>, with the result
        shown here:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql</code></strong>
<span class="errortext">ERROR 2005 (HY000): Unknown MySQL server host '--user' (1)</span>
</pre><p>
        However, in option files, an equal sign is not assumed. Suppose
        the <code class="filename">my.cnf</code> file is as shown here:
      </p><pre data-lang="ini" class="programlisting">[mysql]

user jon</pre><p>
        Trying to start <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> in this case causes a
        different error:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql</code></strong>
<span class="errortext">mysql: unknown option '--user jon'</span>
</pre><p>
        A similar error would occur if you were to write <code class="literal">host
        tonfisk</code> in the option file rather than
        <code class="literal">host=tonfisk</code>. Instead, you must use the equal
        sign:
      </p><pre data-lang="ini" class="programlisting">[mysql]

user=jon</pre><p>
        Now the login attempt succeeds:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql</code></strong>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 8.0.22 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; <strong class="userinput"><code>SELECT USER();</code></strong>
+---------------+
| USER()        |
+---------------+
| jon@localhost |
+---------------+
1 row in set (0.00 sec)
</pre><p>
        This is not the same behavior as with the command line, where
        the equal sign is not required:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --user jon --host tonfisk</code></strong>
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 8.0.22 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; <strong class="userinput"><code>SELECT USER();</code></strong>
+---------------+
| USER()        |
+---------------+
| jon@tonfisk   |
+---------------+
1 row in set (0.00 sec)
</pre><p>
        Specifying an option requiring a value without a value in an
        option file causes the server to abort with an error.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="connection-options"></a>4.2.3 Command Options for Connecting to the Server</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444434056848"></a><p>
      This section describes options supported by most MySQL client
      programs that control how client programs establish connections to
      the server, whether connections are encrypted, and whether
      connections are compressed. These options can be given on the
      command line or in an option file.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#connection-establishment-options" title="Command Options for Connection Establishment">Command Options for Connection Establishment</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#connection-compression-options" title="Command Options for Connection Compression">Command Options for Connection Compression</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="connection-establishment-options"></a>Command Options for Connection Establishment</h4>

</div>

</div>

</div>
<p>
        This section describes options that control how client programs
        establish connections to the server. For additional information
        and examples showing how to use them, see
        <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
</p>
<div class="table">
<a name="idm46444434048704"></a><p class="title"><b>Table 4.3 Connection-Establishment Option Summary</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for establishing connections to the server."><col width="35%"><col width="64%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_general_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_host">--host</a></td>
<td>Host on which MySQL server is located</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_password">--password</a></td>
<td>Password to use when connecting to server</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_port">--port</a></td>
<td>TCP/IP port number for connection</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_general_default-auth"></a>
            <a class="link" href="programs.html#option_general_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><a class="indexterm" name="idm46444434010736"></a><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_general_host"></a>
            <a class="link" href="programs.html#option_general_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><a class="indexterm" name="idm46444434005280"></a><p>
            The host on which the MySQL server is running. The value can
            be a host name, IPv4 address, or IPv6 address. The default
            value is <code class="literal">localhost</code>.
          </p></li><li class="listitem"><p><a name="option_general_password"></a>
            <a class="link" href="programs.html#option_general_password"><code class="option">--password[=<em class="replaceable"><code>pass_val</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>pass_val</code></em>]</code>
          </p><a class="indexterm" name="idm46444433999568"></a><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given, the
            program prompts for one. If given, there must be
            <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_general_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that the
            client program should not prompt for one, use the
            <a class="link" href="programs.html#option_general_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_general_pipe"></a>
            <a class="link" href="programs.html#option_general_pipe"><code class="option">--pipe</code></a>, <code class="option">-W</code>
          </p><a class="indexterm" name="idm46444433990464"></a><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_general_plugin-dir"></a>
            <a class="link" href="programs.html#option_general_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433983584"></a><p>
            The directory in which to look for plugins. Specify this
            option if the <a class="link" href="programs.html#option_general_default-auth"><code class="option">--default-auth</code></a>
            option is used to specify an authentication plugin but the
            client program does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_general_port"></a>
            <a class="link" href="programs.html#option_general_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><a class="indexterm" name="idm46444433977088"></a><p>
            For TCP/IP connections, the port number to use. The default
            port number is 3306.
          </p></li><li class="listitem"><p><a name="option_general_protocol"></a>
            <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><a class="indexterm" name="idm46444433973328"></a><p>
            This option explicitly specifies which protocol to use for
            connecting to the server. It is useful when other connection
            parameters normally result in use of a protocol other than
            the one you want. For example, connections on Unix to
            <code class="literal">localhost</code> are made using a Unix socket
            file by default:
          </p><pre data-lang="terminal" class="programlisting">mysql --host=localhost</pre><p>
            To force a TCP/IP connection to be used instead, specify a
            <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol</code></a> option:
          </p><pre data-lang="terminal" class="programlisting">mysql --host=localhost --protocol=TCP</pre><p>
            The following table shows the permissible
            <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol</code></a> option values and
            indicates the platforms on which each value may be used. The
            values are not case-sensitive.
</p>
<div class="informaltable">
<table summary="Permissible --protocol option values, the connection protocol for each value, and the platforms on which each value may be used."><col width="20%"><col width="50%"><col width="30%"><thead><tr>
                <th scope="col"><a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol</code></a> Value</th>
                <th scope="col">Connection Protocol</th>
                <th scope="col">Permissible Operating Systems</th>
              </tr></thead><tbody><tr>
                <td align="left" scope="row"><code class="literal">TCP</code></td>
                <td align="left">TCP/IP connection to local or remote server</td>
                <td align="left">All</td>
              </tr><tr>
                <td align="left" scope="row"><code class="literal">SOCKET</code></td>
                <td align="left">Unix socket file connection to local server</td>
                <td align="left">Unix only</td>
              </tr><tr>
                <td align="left" scope="row"><code class="literal">PIPE</code></td>
                <td align="left">Named-pipe connection to local or remote server</td>
                <td align="left">Windows only</td>
              </tr><tr>
                <td align="left" scope="row"><code class="literal">MEMORY</code></td>
                <td align="left">Shared-memory connection to local server</td>
                <td align="left">Windows only</td>
</tr></tbody></table>
</div>
</li><li class="listitem"><p><a name="option_general_shared-memory-base-name"></a>
            <a class="link" href="programs.html#option_general_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433936784"></a><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_general_socket"></a>
            <a class="link" href="programs.html#option_general_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><a class="indexterm" name="idm46444433929424"></a><p>
            On Unix, the name of the Unix socket file to use for
            connections made using a named pipe to a local server. The
            default Unix socket file name is
            <code class="filename">/tmp/mysql.sock</code>.
          </p><p>
            On Windows, the name of the named pipe to use for
            connections to a local server. The default Windows pipe name
            is <code class="literal">MySQL</code>. The pipe name is not
            case-sensitive.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_general_user"></a>
            <a class="link" href="programs.html#option_general_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><a class="indexterm" name="idm46444433919328"></a><p>
            The user name of the MySQL account to use for connecting to
            the server. The default user name is <code class="literal">ODBC</code>
            on Windows or your Unix login name on Unix.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="encrypted-connection-options"></a>Command Options for Encrypted Connections</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433915360"></a><a class="indexterm" name="idm46444433913872"></a><a class="indexterm" name="idm46444433912384"></a><a class="indexterm" name="idm46444433910928"></a><p>
        This section describes options for client programs that specify
        whether to use encrypted connections to the server, the names of
        certificate and key files, and other parameters related to
        encrypted-connection support. For examples of suggested use and
        how to check whether a connection is encrypted, see
        <a class="xref" href="security.html#using-encrypted-connections" title="6.3.1 Configuring MySQL to Use Encrypted Connections">Section 6.3.1, “Configuring MySQL to Use Encrypted Connections”</a>.
      </p><p>
        For information about using encrypted connections from the MySQL
        C API, see <a class="xref" href="connectors-apis.html#c-api-encrypted-connections" title="28.7.21 C API Encrypted-Connection Support">Section 28.7.21, “C API Encrypted-Connection Support”</a>.
</p>
<div class="table">
<a name="idm46444433906592"></a><p class="title"><b>Table 4.4 Connection-Encryption Option Summary</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for establishing encrypted connections."><col width="31%"><col width="56%"><col width="12%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_general_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-ca">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-capath">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-cert">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-cipher">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-crl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-crlpath">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-key">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_ssl-mode">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_general_get-server-public-key"></a>
            <a class="link" href="programs.html#option_general_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><a class="indexterm" name="idm46444433847312"></a><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_general_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_general_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_general_server-public-key-path"></a>
            <a class="link" href="programs.html#option_general_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433837376"></a><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_general_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_general_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            This option is available only if MySQL was built using
            OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_general_ssl-ca"></a>
            <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433824736"></a><p>
            The path name of the Certificate Authority (CA) certificate
            file in PEM format. The file contains a list of trusted SSL
            Certificate Authorities.
          </p><p>
            To tell the client not to authenticate the server
            certificate when establishing an encrypted connection to the
            server, specify neither
            <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a> nor
            <a class="link" href="programs.html#option_general_ssl-capath"><code class="option">--ssl-capath</code></a>. The server
            still verifies the client according to any applicable
            requirements established for the client account, and it
            still uses any <a class="link" href="server-administration.html#sysvar_ssl_ca"><code class="literal">ssl_ca</code></a> or
            <a class="link" href="server-administration.html#sysvar_ssl_capath"><code class="literal">ssl_capath</code></a> system variable
            values specified on the server side.
          </p><p>
            To specify the CA file for the server, set the
            <a class="link" href="server-administration.html#sysvar_ssl_ca"><code class="literal">ssl_ca</code></a> system variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-capath"></a>
            <a class="link" href="programs.html#option_general_ssl-capath"><code class="option">--ssl-capath=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433813232"></a><p>
            The path name of the directory that contains trusted SSL
            certificate authority (CA) certificate files in PEM format.
          </p><p>
            To tell the client not to authenticate the server
            certificate when establishing an encrypted connection to the
            server, specify neither
            <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a> nor
            <a class="link" href="programs.html#option_general_ssl-capath"><code class="option">--ssl-capath</code></a>. The server
            still verifies the client according to any applicable
            requirements established for the client account, and it
            still uses any <a class="link" href="server-administration.html#sysvar_ssl_ca"><code class="literal">ssl_ca</code></a> or
            <a class="link" href="server-administration.html#sysvar_ssl_capath"><code class="literal">ssl_capath</code></a> system variable
            values specified on the server side.
          </p><p>
            To specify the CA directory for the server, set the
            <a class="link" href="server-administration.html#sysvar_ssl_capath"><code class="literal">ssl_capath</code></a> system variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-cert"></a>
            <a class="link" href="programs.html#option_general_ssl-cert"><code class="option">--ssl-cert=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433802272"></a><p>
            The path name of the client SSL public key certificate file
            in PEM format.
          </p><p>
            To specify the server SSL public key certificate file, set
            the <a class="link" href="server-administration.html#sysvar_ssl_cert"><code class="literal">ssl_cert</code></a> system
            variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-cipher"></a>
            <a class="link" href="programs.html#option_general_ssl-cipher"><code class="option">--ssl-cipher=<em class="replaceable"><code>cipher_list</code></em></code></a>
          </p><a class="indexterm" name="idm46444433796288"></a><p>
            The list of permissible encryption ciphers for connections
            that use TLS protocols up through TLSv1.2. If no cipher in
            the list is supported, encrypted connections that use these
            TLS protocols will not work.
          </p><p>
            For greatest portability,
            <em class="replaceable"><code>cipher_list</code></em> should be a list of
            one or more cipher names, separated by colons. Examples:
          </p><pre data-lang="terminal" class="programlisting">--ssl-cipher=AES128-SHA
--ssl-cipher=DHE-RSA-AES128-GCM-SHA256:AES128-SHA</pre><p>
            OpenSSL supports the syntax for specifying ciphers described
            in the OpenSSL documentation at
            <a class="ulink" href="https://www.openssl.org/docs/manmaster/man1/ciphers.html" target="_top">https://www.openssl.org/docs/manmaster/man1/ciphers.html</a>.
          </p><p>
            For information about which encryption ciphers MySQL
            supports, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            To specify the encryption ciphers for the server, set the
            <a class="link" href="server-administration.html#sysvar_ssl_cipher"><code class="literal">ssl_cipher</code></a> system variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-crl"></a>
            <a class="link" href="programs.html#option_general_ssl-crl"><code class="option">--ssl-crl=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433786032"></a><p>
            The path name of the file containing certificate revocation
            lists in PEM format.
          </p><p>
            If neither <a class="link" href="programs.html#option_general_ssl-crl"><code class="option">--ssl-crl</code></a> nor
            <a class="link" href="programs.html#option_general_ssl-crlpath"><code class="option">--ssl-crlpath</code></a> is given, no
            CRL checks are performed, even if the CA path contains
            certificate revocation lists.
          </p><p>
            To specify the revocation-list file for the server, set the
            <a class="link" href="server-administration.html#sysvar_ssl_crl"><code class="literal">ssl_crl</code></a> system variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-crlpath"></a>
            <a class="link" href="programs.html#option_general_ssl-crlpath"><code class="option">--ssl-crlpath=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433777632"></a><p>
            The path name of the directory that contains certificate
            revocation-list files in PEM format.
          </p><p>
            If neither <a class="link" href="programs.html#option_general_ssl-crl"><code class="option">--ssl-crl</code></a> nor
            <a class="link" href="programs.html#option_general_ssl-crlpath"><code class="option">--ssl-crlpath</code></a> is given, no
            CRL checks are performed, even if the CA path contains
            certificate revocation lists.
          </p><p>
            To specify the revocation-list directory for the server, set
            the <a class="link" href="server-administration.html#sysvar_ssl_crlpath"><code class="literal">ssl_crlpath</code></a> system
            variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_general_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444433769440"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_general_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_general_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> values
            are permissible:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permissible value for
              <a class="link" href="programs.html#option_general_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_general_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
<p>
            To specify the FIPS mode for the server, set the
            <a class="link" href="server-administration.html#sysvar_ssl_fips_mode"><code class="literal">ssl_fips_mode</code></a> system
            variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-key"></a>
            <a class="link" href="programs.html#option_general_ssl-key"><code class="option">--ssl-key=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444433749312"></a><p>
            The path name of the client SSL private key file in PEM
            format. For better security, use a certificate with an RSA
            key size of at least 2048 bits.
          </p><p>
            If the key file is protected by a passphrase, the client
            program prompts the user for the passphrase. The password
            must be given interactively; it cannot be stored in a file.
            If the passphrase is incorrect, the program continues as if
            it could not read the key.
          </p><p>
            To specify the server SSL private key file, set the
            <a class="link" href="server-administration.html#sysvar_ssl_key"><code class="literal">ssl_key</code></a> system variable.
          </p></li><li class="listitem"><p><a name="option_general_ssl-mode"></a>
            <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode=<em class="replaceable"><code>mode</code></em></code></a>
          </p><a class="indexterm" name="idm46444433742592"></a><p>
            This option specifies the desired security state of the
            connection to the server. These mode values are permissible,
            in order of increasing strictness:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">DISABLED</code>: Establish an unencrypted
                connection.
              </p></li><li class="listitem"><p>
                <code class="literal">PREFERRED</code>: Establish an encrypted
                connection if the server supports encrypted connections,
                falling back to an unencrypted connection if an
                encrypted connection cannot be established. This is the
                default if <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode</code></a> is
                not specified.
              </p><p>
                Encrypted connections over Unix sockets are disabled by
                default, so <code class="literal">PREFERRED</code> does not
                establish an encrypted connection. To enforce encryption
                for Unix socket connections, use a mode of
                <code class="literal">REQUIRED</code> or stricter.
              </p></li><li class="listitem"><p>
                <code class="literal">REQUIRED</code>: Establish an encrypted
                connection if the server supports encrypted connections.
                The connection attempt fails if an encrypted connection
                cannot be established.
              </p></li><li class="listitem"><p>
                <code class="literal">VERIFY_CA</code>: Like
                <code class="literal">REQUIRED</code>, but additionally verify the
                server Certificate Authority (CA) certificate against
                the configured CA certificates. The connection attempt
                fails if no valid matching CA certificates are found.
              </p></li><li class="listitem"><p>
                <code class="literal">VERIFY_IDENTITY</code>: Like
                <code class="literal">VERIFY_CA</code>, but additionally perform
                host name identity verification by checking the host
                name the client uses for connecting to the server
                against the identity in the certificate that the server
                sends to the client:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: square; "><li class="listitem"><p>
                    As of MySQL 8.0.12, if the client uses OpenSSL 1.0.2
                    or higher, the client checks whether the host name
                    that it uses for connecting matches either the
                    Subject Alternative Name value or the Common Name
                    value in the server certificate.
                  </p></li><li class="listitem"><p>
                    Otherwise, the client checks whether the host name
                    that it uses for connecting matches the Common Name
                    value in the server certificate.
</p></li></ul>
</div>
<p>
                The connection fails if there is a mismatch. For
                encrypted connections, this option helps prevent
                man-in-the-middle attacks.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                  Host name identity verification with
                  <code class="literal">VERIFY_IDENTITY</code> does not work with
                  self-signed certificates that are created
                  automatically by the server or manually using
                  <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> (see
                  <a class="xref" href="security.html#creating-ssl-rsa-files-using-mysql" title="6.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL">Section 6.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”</a>).
                  Such self-signed certificates do not contain the
                  server name as the Common Name value.
                </p><p>
                  Host name identity verification also does not work
                  with certificates that specify the Common Name using
                  wildcards because that name is compared verbatim to
                  the server name.
</p>
</div>
</li></ul>
</div>
<p>
            The <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode</code></a> option
            interacts with CA certificate options as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                If <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode</code></a> is not
                explicitly set otherwise, use of
                <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a> or
                <a class="link" href="programs.html#option_general_ssl-capath"><code class="option">--ssl-capath</code></a> implies
                <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode=VERIFY_CA</code></a>.
              </p></li><li class="listitem"><p>
                For <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode</code></a> values of
                <code class="literal">VERIFY_CA</code> or
                <code class="literal">VERIFY_IDENTITY</code>,
                <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a> or
                <a class="link" href="programs.html#option_general_ssl-capath"><code class="option">--ssl-capath</code></a> is also
                required, to supply a CA certificate that matches the
                one used by the server.
              </p></li><li class="listitem"><p>
                An explicit <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode</code></a>
                option with a value other than
                <code class="literal">VERIFY_CA</code> or
                <code class="literal">VERIFY_IDENTITY</code>, together with an
                explicit <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a> or
                <a class="link" href="programs.html#option_general_ssl-capath"><code class="option">--ssl-capath</code></a> option,
                produces a warning that no verification of the server
                certificate will be done, despite a CA certificate
                option being specified.
</p></li></ul>
</div>
<p>
            To require use of encrypted connections by a MySQL account,
            use <a class="link" href="sql-statements.html#create-user" title="13.7.1.3 CREATE USER Statement"><code class="literal">CREATE USER</code></a> to create the
            account with a <code class="literal">REQUIRE SSL</code> clause, or use
            <a class="link" href="sql-statements.html#alter-user" title="13.7.1.1 ALTER USER Statement"><code class="literal">ALTER USER</code></a> for an existing
            account to add a <code class="literal">REQUIRE SSL</code> clause. This
            causes connection attempts by clients that use the account
            to be rejected unless MySQL supports encrypted connections
            and an encrypted connection can be established.
          </p><p>
            The <code class="literal">REQUIRE</code> clause permits other
            encryption-related options, which can be used to enforce
            security requirements stricter than <code class="literal">REQUIRE
            SSL</code>. For additional details about which command
            options may or must be specified by clients that connect
            using accounts configured using the various
            <code class="literal">REQUIRE</code> options, see
            <a class="xref" href="sql-statements.html#create-user-tls" title="CREATE USER SSL/TLS Options">CREATE USER SSL/TLS Options</a>.
          </p></li><li class="listitem"><p><a name="option_general_tls-ciphersuites"></a>
            <a class="link" href="programs.html#option_general_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><a class="indexterm" name="idm46444433691648"></a><p>
            This option specifies which ciphersuites the client permits
            for encrypted connections that use TLSv1.3. The value is a
            list of zero or more colon-separated ciphersuite names. For
            example:
          </p><pre data-lang="terminal" class="programlisting">mysql --tls-ciphersuites="<em class="replaceable"><code>suite1</code></em>:<em class="replaceable"><code>suite2</code></em>:<em class="replaceable"><code>suite3</code></em>"
</pre><p>
            The ciphersuites that can be named for this option depend on
            the SSL library used to compile MySQL. If this option is not
            set, the client permits the default set of ciphersuites. If
            the option is set to the empty string, no ciphersuites are
            enabled and encrypted connections cannot be established. For
            more information, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p><p>
            To specify which ciphersuites the server permits, set the
            <a class="link" href="server-administration.html#sysvar_tls_ciphersuites"><code class="literal">tls_ciphersuites</code></a> system
            variable.
          </p></li><li class="listitem"><p><a name="option_general_tls-version"></a>
            <a class="link" href="programs.html#option_general_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><a class="indexterm" name="idm46444433681504"></a><p>
            This option specifies the TLS protocols the client permits
            for encrypted connections. The value is a list of one or
            more comma-separated protocol versions. For example:
          </p><pre data-lang="terminal" class="programlisting">mysql --tls-version="TLSv1.1,TLSv1.2"</pre><p>
            The protocols that can be named for this option depend on
            the SSL library used to compile MySQL. Permitted protocols
            should be chosen such as not to leave <span class="quote">“<span class="quote">holes</span>”</span>
            in the list. For example, these values do not have holes:
          </p><pre data-lang="terminal" class="programlisting">--tls-version="TLSv1,TLSv1.1,TLSv1.2,TLSv1.3"
--tls-version="TLSv1.1,TLSv1.2,TLSv1.3"
--tls-version="TLSv1.2,TLSv1.3"
--tls-version="TLSv1.3"</pre><p>
            These values do have holes and should not be used:
          </p><pre data-lang="terminal" class="programlisting">--tls-version="TLSv1,TLSv1.2"
--tls-version="TLSv1.1,TLSv1.3"</pre><p>
            For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            To specify which TLS protocols the server permits, set the
            <a class="link" href="server-administration.html#sysvar_tls_version"><code class="literal">tls_version</code></a> system
            variable.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="connection-compression-options"></a>Command Options for Connection Compression</h4>

</div>

</div>

</div>
<p>
        This section describes options that enable client programs to
        control use of compression for connections to the server. For
        additional information and examples showing how to use them, see
        <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
</p>
<div class="table">
<a name="idm46444433669312"></a><p class="title"><b>Table 4.5 Connection-Compression Option Summary</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for compression in connections to the server."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_general_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_general_compress"></a>
            <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><a class="indexterm" name="idm46444433642432"></a><p>
            Compress all information sent between the client and the
            server if possible.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_general_compression-algorithms"></a>
            <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444433636976"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_general_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_general_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444433630320"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="connecting"></a>4.2.4 Connecting to the MySQL Server Using Command Options</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433624144"></a><a class="indexterm" name="idm46444433622688"></a><a class="indexterm" name="idm46444433621616"></a><a class="indexterm" name="idm46444433620128"></a><a class="indexterm" name="idm46444433618640"></a><a class="indexterm" name="idm46444433617568"></a><a class="indexterm" name="idm46444433616496"></a><p>
      This section describes use of command-line options to specify how
      to establish connections to the MySQL server, for clients such as
      <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> or <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>. For
      information on establishing connections using URI-like connection
      strings or key-value pairs, for clients such as MySQL Shell, see
      <a class="xref" href="programs.html#connecting-using-uri-or-key-value-pairs" title="4.2.5 Connecting to the Server Using URI-Like Strings or Key-Value Pairs">Section 4.2.5, “Connecting to the Server Using URI-Like Strings or Key-Value Pairs”</a>. For
      additional information if you are unable to connect, see
      <a class="xref" href="security.html#problems-connecting" title="6.2.21 Troubleshooting Problems Connecting to MySQL">Section 6.2.21, “Troubleshooting Problems Connecting to MySQL”</a>.
    </p><p>
      For a client program to connect to the MySQL server, it must use
      the proper connection parameters, such as the name of the host
      where the server is running and the user name and password of your
      MySQL account. Each connection parameter has a default value, but
      you can override default values as necessary using program options
      specified either on the command line or in an option file.
    </p><p>
      The examples here use the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client program,
      but the principles apply to other clients such as
      <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>, <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>, or
      <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>.
    </p><p>
      This command invokes <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> without specifying
      any explicit connection parameters:
    </p><pre data-lang="terminal" class="programlisting">mysql</pre><p>
      Because there are no parameter options, the default values apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          The default host name is <code class="literal">localhost</code>. On
          Unix, this has a special meaning, as described later.
        </p></li><li class="listitem"><p>
          The default user name is <code class="literal">ODBC</code> on Windows or
          your Unix login name on Unix.
        </p></li><li class="listitem"><p>
          No password is sent because neither
          <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a> nor
          <code class="option">-p</code> is given.
        </p></li><li class="listitem"><p>
          For <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, the first nonoption argument is
          taken as the name of the default database. Because there is no
          such argument, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> selects no default
          database.
</p></li></ul>
</div>
<p>
      To specify the host name and user name explicitly, as well as a
      password, supply appropriate options on the command line. To
      select a default database, add a database-name argument. Examples:
    </p><pre data-lang="terminal" class="programlisting">mysql --host=localhost --user=myname --password=<em class="replaceable"><code>password</code></em> mydb
mysql -h localhost -u myname -p<em class="replaceable"><code>password</code></em> mydb
</pre><p>
      For password options, the password value is optional:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If you use a <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a> or
          <code class="option">-p</code> option and specify a password value, there
          must be <span class="emphasis"><em>no space</em></span> between
          <a class="link" href="programs.html#option_general_password"><code class="option">--password=</code></a> or
          <code class="option">-p</code> and the password following it.
        </p></li><li class="listitem"><p>
          If you use <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a> or
          <code class="option">-p</code> but do not specify a password value, the
          client program prompts you to enter the password. The password
          is not displayed as you enter it. This is more secure than
          giving the password on the command line, which might enable
          other users on your system to see the password line by
          executing a command such as <span class="command"><strong>ps</strong></span>. See
          <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
        </p></li><li class="listitem"><p>
          To explicitly specify that there is no password and that the
          client program should not prompt for one, use the
          <a class="link" href="programs.html#option_general_password"><code class="option">--skip-password</code></a>
          option.
</p></li></ul>
</div>
<p>
      As just mentioned, including the password value on the command
      line can be a security risk. To avoid this risk, specify the
      <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a> or <code class="option">-p</code>
      option without any following password value:
    </p><pre data-lang="terminal" class="programlisting">mysql --host=localhost --user=myname --password mydb
mysql -h localhost -u myname -p mydb</pre><p>
      When the <a class="link" href="programs.html#option_general_password"><code class="option">--password</code></a> or
      <code class="option">-p</code> option is given with no password value, the
      client program prints a prompt and waits for you to enter the
      password. (In these examples, <code class="literal">mydb</code> is
      <span class="emphasis"><em>not</em></span> interpreted as a password because it is
      separated from the preceding password option by a space.)
    </p><p>
      On some systems, the library routine that MySQL uses to prompt for
      a password automatically limits the password to eight characters.
      That limitation is a property of the system library, not MySQL.
      Internally, MySQL does not have any limit for the length of the
      password. To work around the limitation on systems affected by it,
      specify your password in an option file (see
      <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>). Another workaround is to change
      your MySQL password to a value that has eight or fewer characters,
      but that may be unacceptable because shorter passwords tend to be
      less secure.
    </p><p>
      Client programs determine what type of connection to make as
      follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          If the host is not specified or is
          <code class="literal">localhost</code>, a connection to the local host
          occurs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              On Windows, the client connects using a shared-memory
              connection, if the server was started with the
              <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
              variable enabled to support shared-memory connections.
            </p></li><li class="listitem"><p>
              On Unix, MySQL programs treat the host name
              <code class="literal">localhost</code> specially, in a way that is
              likely different from what you expect compared to other
              network-based programs: the client connects using a Unix
              socket file. The <a class="link" href="programs.html#option_general_socket"><code class="option">--socket</code></a>
              option or the <code class="literal">MYSQL_UNIX_PORT</code>
              environment variable may be used to specify the socket
              name.
</p><a class="indexterm" name="idm46444433562736"></a></li></ul>
</div>
</li><li class="listitem"><p>
          On Windows, if <code class="literal">host</code> is <code class="literal">.</code>
          (period), or TCP/IP is not enabled and
          <a class="link" href="programs.html#option_general_socket"><code class="option">--socket</code></a> is not specified or
          the host is empty, the client connects using a named pipe, if
          the server was started with the
          <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
          enabled to support named-pipe connections. If named-pipe
          connections are not supported or if the user making the
          connection is not a member of the Windows group specified by
          the
          <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
          system variable, an error occurs.
        </p></li><li class="listitem"><p>
          Otherwise, the connection uses TCP/IP.
</p></li></ul>
</div>
<p>
      The <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol</code></a> option enables you
      to establish a particular type of connection even when other
      options normally result in use of a different protocol. That is,
      <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol</code></a> specifies the
      connection protocol explicitly and overrides the preceding rules,
      even for <code class="literal">localhost</code>.
    </p><p>
      Only connection options that are relevant to the selected protocol
      are used or checked. Other connection options are ignored. For
      example, with <a class="link" href="programs.html#option_general_host"><code class="option">--host=localhost</code></a> on
      Unix, the client attempts to connect to the local server using a
      Unix socket file. This occurs even if a
      <a class="link" href="programs.html#option_general_port"><code class="option">--port</code></a> or <code class="option">-P</code>
      option is given to specify a port number.
    </p><p>
      To ensure that the client makes a TCP/IP connection to the local
      server, use <a class="link" href="programs.html#option_general_host"><code class="option">--host</code></a> or
      <code class="option">-h</code> to specify a host name value of
      <code class="literal">127.0.0.1</code>, or the IP address or name of the
      local server. You can also specify the connection protocol
      explicitly, even for <code class="literal">localhost</code>, by using the
      <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol=TCP</code></a> option. Examples:
    </p><pre data-lang="terminal" class="programlisting">mysql --host=127.0.0.1
mysql --protocol=TCP</pre><p>
      If the server is configured to accept IPv6 connections, clients
      can connect to the local server over IPv6 using
      <a class="link" href="programs.html#option_general_host"><code class="option">--host=::1</code></a>. See
      <a class="xref" href="server-administration.html#ipv6-support" title="5.1.13 IPv6 Support">Section 5.1.13, “IPv6 Support”</a>.
    </p><p>
      On Windows, you can force a MySQL client to use a named-pipe
      connection by specifying the
      <a class="link" href="programs.html#option_general_pipe"><code class="option">--pipe</code></a> or
      <a class="link" href="programs.html#option_general_protocol"><code class="option">--protocol=PIPE</code></a> option, or by
      specifying <code class="literal">.</code> (period) as the host name. If the
      server was not started with the
      <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
      enabled to support named-pipe connections or if the user making
      the connection is not a member of the Windows group specified by
      the <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
      system variable, an error occurs. Use the
      <a class="link" href="programs.html#option_general_socket"><code class="option">--socket</code></a> option to specify the
      name of the pipe if you do not want to use the default pipe name.
    </p><p>
      Connections to remote servers use TCP/IP. This command connects to
      the server running on <code class="literal">remote.example.com</code> using
      the default port number (3306):
    </p><pre data-lang="terminal" class="programlisting">mysql --host=remote.example.com</pre><p>
      To specify a port number explicitly, use the
      <a class="link" href="programs.html#option_general_port"><code class="option">--port</code></a> or <code class="option">-P</code>
      option:
    </p><pre data-lang="terminal" class="programlisting">mysql --host=remote.example.com --port=13306</pre><p>
      You can specify a port number for connections to a local server,
      too. However, as indicated previously, connections to
      <code class="literal">localhost</code> on Unix use a socket file by default,
      so unless you force a TCP/IP connection as previously described,
      any option that specifies a port number is ignored.
    </p><p>
      For this command, the program uses a socket file on Unix and the
      <a class="link" href="programs.html#option_general_port"><code class="option">--port</code></a> option is ignored:
    </p><pre data-lang="terminal" class="programlisting">mysql --port=13306 --host=localhost</pre><p>
      To cause the port number to be used, force a TCP/IP connection.
      For example, invoke the program in either of these ways:
    </p><pre data-lang="terminal" class="programlisting">mysql --port=13306 --host=127.0.0.1
mysql --port=13306 --protocol=TCP</pre><p>
      For additional information about options that control how client
      programs establish connections to the server, see
      <a class="xref" href="programs.html#connection-options" title="4.2.3 Command Options for Connecting to the Server">Section 4.2.3, “Command Options for Connecting to the Server”</a>.
    </p><p>
      It is possible to specify connection parameters without entering
      them on the command line each time you invoke a client program:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Specify the connection parameters in the
          <code class="literal">[client]</code> section of an option file. The
          relevant section of the file might look like this:
        </p><a class="indexterm" name="idm46444433518720"></a><a class="indexterm" name="idm46444433517648"></a><pre data-lang="ini" class="programlisting">[client]
host=<em class="replaceable"><code>host_name</code></em>
user=<em class="replaceable"><code>user_name</code></em>
password=<em class="replaceable"><code>password</code></em>
</pre><p>
          For more information, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
        </p></li><li class="listitem"><p>
          Some connection parameters can be specified using environment
          variables. Examples:
</p><a class="indexterm" name="idm46444433511920"></a><a class="indexterm" name="idm46444433510832"></a><a class="indexterm" name="idm46444433509344"></a><a class="indexterm" name="idm46444433508256"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
              To specify the host for <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, use
              <code class="literal">MYSQL_HOST</code>.
            </p></li><li class="listitem"><p>
              On Windows, to specify the MySQL user name, use
              <code class="literal">USER</code>.
</p></li></ul>
</div>
<p>
          For a list of supported environment variables, see
          <a class="xref" href="programs.html#environment-variables" title="4.9 Environment Variables">Section 4.9, “Environment Variables”</a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="connecting-using-uri-or-key-value-pairs"></a>4.2.5 Connecting to the Server Using URI-Like Strings or Key-Value Pairs</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433499264"></a><a class="indexterm" name="idm46444433497808"></a><p>
      This section describes use of URI-like connection strings or
      key-value pairs to specify how to establish connections to the
      MySQL server, for clients such as MySQL Shell. For information on
      establishing connections using command-line options, for clients
      such as <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> or <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>,
      see <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>. For additional information if
      you are unable to connect, see
      <a class="xref" href="security.html#problems-connecting" title="6.2.21 Troubleshooting Problems Connecting to MySQL">Section 6.2.21, “Troubleshooting Problems Connecting to MySQL”</a>.
</p><a class="indexterm" name="idm46444433491760"></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
        The term <span class="quote">“<span class="quote">URI-like</span>”</span> signifies connection-string
        syntax that is similar to but not identical to the URI (uniform
        resource identifier) syntax defined by
        <a class="ulink" href="https://tools.ietf.org/html/rfc3986" target="_top">RFC
        3986</a>.
</p>
</div>
<p>
      The following MySQL clients support connecting to a MySQL server
      using a URI-like connection string or key-value pairs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          MySQL Shell
        </p></li><li class="listitem"><p>
          MySQL Connectors which implement X DevAPI
</p></li></ul>
</div>
<p>
      This section documents all valid URI-like string and key-value
      pair connection parameters, many of which are similar to those
      specified with command-line options:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
          Parameters specified with a URI-like string use a syntax such
          as <code class="literal">myuser@example.com:3306/main-schema</code>. For
          the full syntax, see <a class="xref" href="programs.html#connecting-using-uri" title="Connecting Using URI-Like Connection Strings">Connecting Using URI-Like Connection Strings</a>.
        </p></li><li class="listitem"><p>
          Parameters specified with key-value pairs use a syntax such as
          <code class="literal">{user:'myuser', host:'example.com', port:3306,
          schema:'main-schema'}</code>. For the full syntax, see
          <a class="xref" href="programs.html#connecting-using-key-value-pairs" title="Connecting Using Key-Value Pairs">Connecting Using Key-Value Pairs</a>.
</p></li></ul>
</div>
<p>
      Connection parameters are not case-sensitive. Each parameter, if
      specified, can be given only once. If a parameter is specified
      more than once, an error occurs.
    </p><p>
      This section covers the following topics:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#connection-parameters-base" title="Base Connection Parameters">Base Connection Parameters</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#connection-parameters-additional" title="Additional Connection parameters">Additional Connection parameters</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#connecting-using-uri" title="Connecting Using URI-Like Connection Strings">Connecting Using URI-Like Connection Strings</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#connecting-using-key-value-pairs" title="Connecting Using Key-Value Pairs">Connecting Using Key-Value Pairs</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="connection-parameters-base"></a>Base Connection Parameters</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433473776"></a><p>
        The following discussion describes the parameters available when
        specifying a connection to MySQL. These parameters can be
        provided using either a string that conforms to the base
        URI-like syntax (see <a class="xref" href="programs.html#connecting-using-uri" title="Connecting Using URI-Like Connection Strings">Connecting Using URI-Like Connection Strings</a>), or
        as key-value pairs (see
        <a class="xref" href="programs.html#connecting-using-key-value-pairs" title="Connecting Using Key-Value Pairs">Connecting Using Key-Value Pairs</a>).
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <em class="replaceable"><code>scheme</code></em>: The connection protocol
            to use. Use <code class="literal">mysqlx</code> for X Protocol
            connections and <code class="literal">mysql</code> for classic MySQL
            protocol connections. If no protocol is specified, the
            server attempts to guess the protocol.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>user</code></em>: The MySQL user account to
            provide for the authentication process.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>password</code></em>: The password to use for
            the authentication process.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
              Specifying an explicit password in the connection
              specification is insecure and not recommended. Later
              discussion shows how to cause an interactive prompt for
              the password to occur.
</p>
</div>
</li><li class="listitem"><p>
            <em class="replaceable"><code>host</code></em>: The host on which the
            server instance is running. The value can be a host name,
            IPv4 address, or IPv6 address. If no host is specified, the
            default is <code class="literal">localhost</code>.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>port</code></em>: The TCP/IP network port on
            which the target MySQL server is listening for connections.
            If no port is specified, the default is 33060 for
            X Protocol connections and 3306 for classic MySQL protocol
            connections.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>socket</code></em>: The path to a Unix socket
            file or the name of a Windows named pipe. Values are local
            file paths. In URI-like strings, they must be encoded, using
            either percent encoding or by surrounding the path with
            parentheses. Parentheses eliminate the need to percent
            encode characters such as the <code class="literal">/</code> directory
            separator character. For example, to connect as
            <code class="literal">root@localhost</code> using the Unix socket
            <code class="filename">/tmp/mysql.sock</code>, specify the path using
            percent encoding as
            <code class="literal">root@localhost?socket=%2Ftmp%2Fmysql.sock</code>,
            or using parentheses as
            <code class="literal">root@localhost?socket=(/tmp/mysql.sock)</code>.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>schema</code></em>: The default database for
            the connection. If no database is specified, the connection
            has no default database.
</p></li></ul>
</div>
<p>
        The handling of localhost on Unix depends on the type of
        connection protocol. Connections using classic MySQL protocol handle
        localhost in the same way as other MySQL clients, which means
        that localhost is assumed to be for socket based connections.
        For connections using X Protocol, the behaviour of localhost
        differs in that it is assumed to represent the loopback address,
        for example IPv4 address 127.0.0.1.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="connection-parameters-additional"></a>Additional Connection parameters</h4>

</div>

</div>

</div>
<p>
        You can specify options for the connection, either as attributes
        in a URI-like string by appending
        <code class="literal">?<em class="replaceable"><code>attribute=value</code></em></code>,
        or as key-value pairs. The following options are available:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">ssl-mode</code>: The desired security state for
            the connection. The following modes are permissible:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">DISABLED</code>
              </p></li><li class="listitem"><p>
                <code class="literal">PREFERRED</code>
              </p></li><li class="listitem"><p>
                <code class="literal">REQUIRED</code>
              </p></li><li class="listitem"><p>
                <code class="literal">VERIFY_CA</code>
              </p></li><li class="listitem"><p>
                <code class="literal">VERIFY_IDENTITY</code>
</p></li></ul>
</div>
<p>
            For information about these modes, see the
            <a class="link" href="programs.html#option_general_ssl-mode"><code class="option">--ssl-mode</code></a> option
            description in
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-ca</code>: The path to the X.509 certificate
            authority file in PEM format.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-capath</code>: The path to the directory
            that contains the X.509 certificates authority files in PEM
            format.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-cert</code>: The path to the X.509
            certificate file in PEM format.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-cipher</code>: The encryption cipher to use
            for connections that use TLS protocols up through TLSv1.2.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-crl</code>: The path to the file that
            contains certificate revocation lists in PEM format.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-crlpath</code>: The path to the directory
            that contains certificate revocation-list files in PEM
            format.
          </p></li><li class="listitem"><p>
            <code class="literal">ssl-key</code>: The path to the X.509 key file
            in PEM format.
          </p></li><li class="listitem"><p>
            <code class="literal">tls-version</code>: The TLS protocols permitted
            for classic MySQL protocol encrypted connections. This option is
            supported by MySQL Shell only. The value of
            <code class="literal">tls-version</code> (singular) is a comma
            separated list, for example
            <code class="literal">TLSv1.1,TLSv1.2</code>. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
            This option depends on the <code class="literal">ssl-mode</code>
            option not being set to <code class="literal">DISABLED</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">tls-versions</code>: The permissible TLS
            protocols for encrypted X Protocol connections. The value
            of <code class="literal">tls-versions</code> (plural) is an array such
            as <code class="literal">[TLSv1.2,TLSv1.3]</code>. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
            This option depends on the <code class="literal">ssl-mode</code>
            option not being set to <code class="literal">DISABLED</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">tls-ciphersuites</code>: The permitted TLS
            cipher suites. The value of
            <code class="literal">tls-ciphersuites</code> is a list of IANA cipher
            suite names as listed at
            <a class="ulink" href="https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4" target="_top">TLS
            Ciphersuites</a>. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
            This option depends on the <code class="literal">ssl-mode</code>
            option not being set to <code class="literal">DISABLED</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">auth-method</code>: The authentication method to
            use for the connection. The default is
            <code class="literal">AUTO</code>, meaning that the server attempts to
            guess. The following methods are permissible:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">AUTO</code>
              </p></li><li class="listitem"><p>
                <code class="literal">MYSQL41</code>
              </p></li><li class="listitem"><p>
                <code class="literal">SHA256_MEMORY</code>
              </p></li><li class="listitem"><p>
                <code class="literal">FROM_CAPABILITIES</code>
              </p></li><li class="listitem"><p>
                <code class="literal">FALLBACK</code>
              </p></li><li class="listitem"><p>
                <code class="literal">PLAIN</code>
</p></li></ul>
</div>
<p>
            For X Protocol connections, any configured
            <code class="literal">auth-method</code> is overridden to this
            sequence of authentication methods:
            <code class="literal">MYSQL41</code>,
            <code class="literal">SHA256_MEMORY</code>, <code class="literal">PLAIN</code>.

            
          </p></li><li class="listitem"><p>
            <code class="literal">get-server-public-key</code>: Request from the
            server the public key required for RSA key pair-based
            password exchange. Use when connecting to MySQL 8.0 servers
            over classic MySQL protocol with SSL mode
            <code class="literal">DISABLED</code>. You must specify the protocol
            in this case. For example:
          </p><pre data-lang="simple" class="programlisting">mysql://user@localhost:3306?get-server-public-key=true</pre><p>
            This option applies to clients that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <code class="literal">server-public-key-path=<em class="replaceable"><code>file_name</code></em></code>
            is given and specifies a valid public key file, it takes
            precedence over <code class="literal">get-server-public-key</code>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">server-public-key-path</code>: The path name to
            a file in PEM format containing a client-side copy of the
            public key required by the server for RSA key pair-based
            password exchange. Use when connecting to MySQL 8.0 servers
            over classic MySQL protocol with SSL mode
            <code class="literal">DISABLED</code>.
          </p><p>
            This option applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <code class="literal">server-public-key-path=<em class="replaceable"><code>file_name</code></em></code>
            is given and specifies a valid public key file, it takes
            precedence over <code class="literal">get-server-public-key</code>.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">connect-timeout</code>: An integer value used to
            configure the number of seconds that clients, such as
            MySQL Shell, wait until they stop trying to connect to an
            unresponsive MySQL server.
          </p></li><li class="listitem"><p>
            <code class="literal">compression</code>: This option for MySQL Shell
            connections only requests or disables compression for the
            connection. In MySQL Shell 8.0.14 through 8.0.19 it
            operates for classic MySQL protocol connections only, and from
            MySQL Shell 8.0.20 it also operates for X Protocol
            connections. From MySQL Shell 8.0.20 the options
            <code class="literal">compression-algorithms</code> and
            <code class="literal">compression-level</code> are also available for
            more control over connection compression. For information on
            MySQL Shell's connection compression control, see
            <a class="ulink" href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-compressed-connections.html" target="_top">Using Compressed Connections</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">connection-attributes</code>: Controls the
            key-value pairs that application programs pass to the server
            at connect time. For general information about connection
            attributes, see
            <a class="xref" href="performance-schema.html#performance-schema-connection-attribute-tables" title="26.12.9 Performance Schema Connection Attribute Tables">Section 26.12.9, “Performance Schema Connection Attribute Tables”</a>.
            Clients usually define a default set of attributes, which
            can be disabled or enabled. For example:
          </p><pre data-lang="simple" class="programlisting">mysqlx://user@host?connection-attributes
mysqlx://user@host?connection-attributes=true
mysqlx://user@host?connection-attributes=false</pre><p>
            The default behavior is to send the default attribute set.
            Applications can specify attributes to be passed in addition
            to the default attributes. You specify additional connection
            attributes as a <code class="literal">connection-attributes</code>
            parameter in a connection string. The
            <code class="literal">connection-attributes</code> parameter value
            must be empty (the same as specifying
            <code class="literal">true</code>), a <code class="literal">Boolean</code> value
            (<code class="literal">true</code> or <code class="literal">false</code> to
            enable or disable the default attribute set), or a list or
            zero or more <code class="literal">key=value</code> specifiers
            separated by commas (to be sent in addition to the default
            attribute set). Within a list, a missing key value evaluates
            as an empty string. Further examples:
          </p><pre data-lang="simple" class="programlisting">mysqlx://user@host?connection-attributes=[attr1=val1,attr2,attr3=]
mysqlx://user@host?connection-attributes=[]</pre><p>
            Application-defined attribute names cannot begin with
            <code class="literal">_</code> because such names are reserved for
            internal attributes.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="connecting-using-uri"></a>Connecting Using URI-Like Connection Strings</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433356256"></a><p>
        You can specify a connection to MySQL Server using a URI-like
        string. Such strings can be used with the MySQL Shell with the
        <a class="ulink" href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysqlsh.html#option_mysqlsh_uri" target="_top"><code class="option">--uri</code></a> command option, the
        MySQL Shell <code class="literal">\connect</code> command, and MySQL
        Connectors which implement X DevAPI.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The term <span class="quote">“<span class="quote">URI-like</span>”</span> signifies connection-string
          syntax that is similar to but not identical to the URI
          (uniform resource identifier) syntax defined by
          <a class="ulink" href="https://tools.ietf.org/html/rfc3986" target="_top">RFC
          3986</a>.
</p>
</div>
<p>
        A URI-like connection string has the following syntax:
      </p><pre data-lang="simple" class="programlisting">[<em class="replaceable"><code>scheme</code></em>://][<em class="replaceable"><code>user</code></em>[:[<em class="replaceable"><code>password</code></em>]]@]<em class="replaceable"><code>host</code></em>[:<em class="replaceable"><code>port</code></em>][/<em class="replaceable"><code>schema</code></em>][?<em class="replaceable"><code>attribute1=value1&amp;attribute2=value2...</code></em>
</pre>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
          Percent encoding must be used for reserved characters in the
          elements of the URI-like string. For example, if you specify a
          string that includes the <code class="literal">@</code> character, the
          character must be replaced by <code class="literal">%40</code>. If you
          include a zone ID in an IPv6 address, the <code class="literal">%</code>
          character used as the separator must be replaced with
          <code class="literal">%25</code>.
</p>
</div>
<p>
        The parameters you can use in a URI-like connection string are
        described at <a class="xref" href="programs.html#connection-parameters-base" title="Base Connection Parameters">Base Connection Parameters</a>.
      </p><p>
        MySQL Shell's <code class="literal">shell.parseUri()</code> and
        <code class="literal">shell.unparseUri()</code> methods can be used to
        deconstruct and assemble a URI-like connection string. Given a
        URI-like connection string, <code class="literal">shell.parseUri()</code>
        returns a dictionary containing each element found in the
        string. <code class="literal">shell.unparseUri()</code> converts a
        dictionary of URI components and connection options into a valid
        URI-like connection string for connecting to MySQL, which can be
        used in MySQL Shell or by MySQL Connectors which implement
        X DevAPI.
      </p><p>
        If no password is specified in the URI-like string, which is
        recommended, interactive clients prompt for the password. The
        following examples show how to specify URI-like strings with the
        user name <em class="replaceable"><code>user_name</code></em>. In each case,
        the password is prompted for.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            An X Protocol connection to a local server instance
            listening at port 33065.
          </p><pre data-lang="simple" class="programlisting">mysqlx://<em class="replaceable"><code>user_name</code></em>@localhost:33065
</pre></li><li class="listitem"><p>
            A classic MySQL protocol connection to a local server instance
            listening at port 3333.
          </p><pre data-lang="simple" class="programlisting">mysql://<em class="replaceable"><code>user_name</code></em>@localhost:3333
</pre></li><li class="listitem"><p>
            An X Protocol connection to a remote server instance, using
            a host name, an IPv4 address, and an IPv6 address.
          </p><pre data-lang="simple" class="programlisting">mysqlx://<em class="replaceable"><code>user_name</code></em>@server.example.com/
mysqlx://<em class="replaceable"><code>user_name</code></em>@198.51.100.14:123
mysqlx://<em class="replaceable"><code>user_name</code></em>@[2001:db8:85a3:8d3:1319:8a2e:370:7348]
</pre></li><li class="listitem"><p>
            An X Protocol connection using a socket, with the path
            provided using either percent encoding or parentheses.
          </p><pre data-lang="simple" class="programlisting">mysqlx://<em class="replaceable"><code>user_name</code></em>@/<em class="replaceable"><code>path</code></em>%2F<em class="replaceable"><code>to</code></em>%2F<em class="replaceable"><code>socket.sock</code></em>
mysqlx://<em class="replaceable"><code>user_name</code></em>@(<em class="replaceable"><code>/path/to/socket.sock</code></em>)
</pre></li><li class="listitem"><p>
            An optional path can be specified, which represents a
            database.
          </p><pre data-lang="simple" class="programlisting"># use 'world' as the default database
mysqlx://<em class="replaceable"><code>user_name</code></em>@198.51.100.1/world

# use 'world_x' as the default database, encoding _ as %5F
mysqlx://<em class="replaceable"><code>user_name</code></em>@198.51.100.2:33060/world%5Fx
</pre></li><li class="listitem"><p>
            An optional query can be specified, consisting of values
            each given as a
            <code class="literal"><em class="replaceable"><code>key</code></em>=<em class="replaceable"><code>value</code></em></code>
            pair or as a single <em class="replaceable"><code>key</code></em>. To
            specify multiple values, separate them by
            <code class="literal">,</code> characters. A mix of
            <code class="literal"><em class="replaceable"><code>key</code></em>=<em class="replaceable"><code>value</code></em></code>
            and <em class="replaceable"><code>key</code></em> values is permissible.
            Values can be of type list, with list values ordered by
            appearance. Strings must be either percent encoded or
            surrounded by parentheses. The following are equivalent.
          </p><pre data-lang="simple" class="programlisting">ssluser@127.0.0.1?ssl-ca=%2Froot%2Fclientcert%2Fca-cert.pem\
&amp;ssl-cert=%2Froot%2Fclientcert%2Fclient-cert.pem\
&amp;ssl-key=%2Froot%2Fclientcert%2Fclient-key

ssluser@127.0.0.1?ssl-ca=(/root/clientcert/ca-cert.pem)\
&amp;ssl-cert=(/root/clientcert/client-cert.pem)\
&amp;ssl-key=(/root/clientcert/client-key)</pre></li><li class="listitem"><p>
            To specify a TLS version and ciphersuite to use for
            encrypted connections:
          </p><pre class="programlisting">mysql://<em class="replaceable"><code>user_name</code></em>@198.51.100.2:3306/world%5Fx?\
tls-versions=[TLSv1.2,TLSv1.3]&amp;tls-ciphersuites=[TLS_DHE_PSK_WITH_AES_128_\
GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256]
</pre></li></ul>
</div>
<p>
        The previous examples assume that connections require a
        password. With interactive clients, the specified user's
        password is requested at the login prompt. If the user account
        has no password (which is insecure and not recommended), or if
        socket peer-credential authentication is in use (for example,
        with Unix socket connections), you must explicitly specify in
        the connection string that no password is being provided and the
        password prompt is not required. To do this, place a
        <code class="literal">:</code> after the
        <em class="replaceable"><code>user_name</code></em> in the string but do not
        specify a password after it. For example:
      </p><pre data-lang="simple" class="programlisting">mysqlx://<em class="replaceable"><code>user_name</code></em>:@localhost
</pre>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="connecting-using-key-value-pairs"></a>Connecting Using Key-Value Pairs</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433305040"></a><p>
        In MySQL Shell and some MySQL Connectors which implement
        X DevAPI, you can specify a connection to MySQL Server using
        key-value pairs, supplied in language-natural constructs for the
        implementation. For example, you can supply connection
        parameters using key-value pairs as a JSON object in JavaScript,
        or as a dictionary in Python. Regardless of the way the
        key-value pairs are supplied, the concept remains the same: the
        keys as described in this section can be assigned values that
        are used to specify a connection. You can specify connections
        using key-value pairs in MySQL Shell's
        <code class="literal">shell.connect()</code> method or InnoDB cluster's
        <code class="literal">dba.createCluster()</code> method, and with some of
        the MySQL Connectors which implement X DevAPI.
      </p><p>
        Generally, key-value pairs are surrounded by
        <code class="literal">{</code> and <code class="literal">}</code> characters and the
        <code class="literal">,</code> character is used as a separator between
        key-value pairs. The <code class="literal">:</code> character is used
        between keys and values, and strings must be delimited (for
        example, using the <code class="literal">'</code> character). It is not
        necessary to percent encode strings, unlike URI-like connection
        strings.
      </p><p>
        A connection specified as key-value pairs has the following
        format:
      </p><pre data-lang="simple" class="programlisting">{ <em class="replaceable"><code>key</code></em>: <em class="replaceable"><code>value</code></em>, <em class="replaceable"><code>key</code></em>: <em class="replaceable"><code>value</code></em>, ...} 
</pre><p>
        The parameters you can use as keys for a connection are
        described at <a class="xref" href="programs.html#connection-parameters-base" title="Base Connection Parameters">Base Connection Parameters</a>.
      </p><p>
        If no password is specified in the key-value pairs, which is
        recommended, interactive clients prompt for the password. The
        following examples show how to specify connections using
        key-value pairs with the user name
        <code class="literal">'<em class="replaceable"><code>user_name</code></em>'</code>. In
        each case, the password is prompted for.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            An X Protocol connection to a local server instance
            listening at port 33065.
          </p><pre data-lang="simple" class="programlisting">{user:'<em class="replaceable"><code>user_name</code></em>', host:'localhost', port:33065}
</pre></li><li class="listitem"><p>
            A classic MySQL protocol connection to a local server instance
            listening at port 3333.
          </p><pre data-lang="simple" class="programlisting">{user:'<em class="replaceable"><code>user_name</code></em>', host:'localhost', port:3333}
</pre></li><li class="listitem"><p>
            An X Protocol connection to a remote server instance, using
            a host name, an IPv4 address, and an IPv6 address.
          </p><pre data-lang="simple" class="programlisting">{user:'<em class="replaceable"><code>user_name</code></em>', host:'server.example.com'}
{user:'<em class="replaceable"><code>user_name</code></em>', host:198.51.100.14:123}
{user:'<em class="replaceable"><code>user_name</code></em>', host:[2001:db8:85a3:8d3:1319:8a2e:370:7348]}
</pre></li><li class="listitem"><p>
            An X Protocol connection using a socket.
          </p><pre data-lang="simple" class="programlisting">{user:'<em class="replaceable"><code>user_name</code></em>', socket:'<em class="replaceable"><code>/path/to/socket/file</code></em>'}
</pre></li><li class="listitem"><p>
            An optional schema can be specified, which represents a
            database.
          </p><pre data-lang="simple" class="programlisting">{user:'<em class="replaceable"><code>user_name</code></em>', host:'localhost', schema:'world'}
</pre></li></ul>
</div>
<p>
        The previous examples assume that connections require a
        password. With interactive clients, the specified user's
        password is requested at the login prompt. If the user account
        has no password (which is insecure and not recommended), or if
        socket peer-credential authentication is in use (for example,
        with Unix socket connections), you must explicitly specify that
        no password is being provided and the password prompt is not
        required. To do this, provide an empty string using
        <code class="literal">''</code> after the <code class="literal">password</code> key.
        For example:
      </p><pre data-lang="simple" class="programlisting">{user:'<em class="replaceable"><code>user_name</code></em>', password:'', host:'localhost'}
</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="connection-compression-control"></a>4.2.6 Connection Compression Control</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433272192"></a><a class="indexterm" name="idm46444433271120"></a><p>
      Connections to the server can use a compressed protocol that
      reduces the number of bytes sent over the connection. By default,
      connections are uncompressed, but can be compressed if the server
      and the client agree on the compression algorithm to use.
    </p><p>
      Compressed connections originate on the client side but affect CPU
      load on both the client and server sides because both sides
      perform compression and decompression operations. Because enabling
      compression decreases performance, its benefits occur primarily
      when there is low network bandwidth, network transfer time
      dominates the cost of compression and decompression operations,
      and result sets are large.
    </p><p>
      This section describes the available compression-control
      configuration parameters and the information sources available for
      monitoring use of compression.
    </p><p>
      Compression control applies to connections to the server by client
      programs and by servers participating in master/slave replication
      or Group Replication. Compression control does not apply to
      connections for <code class="literal">FEDERATED</code> tables. In the
      following discussion, <span class="quote">“<span class="quote">client connection</span>”</span> is
      shorthand for a connection to the server originating from any
      source for which compression is supported, unless context
      indicates a specific connection type.
    </p><p>
      X Protocol connections to a MySQL Server instance support
      compression from MySQL 8.0.19, but connection compression for
      X Protocol operates independently from the connection compression
      described in this section, and is controlled separately. See
      <a class="xref" href="document-store.html#x-plugin-connection-compression" title="20.5.5 Connection Compression with X Plugin">Section 20.5.5, “Connection Compression with X Plugin”</a> for information
      on X Protocol's connection compression.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#connection-compression-configuration" title="Connection Compression Configuration">Connection Compression Configuration</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#connection-compression-monitoring" title="Connection Compression Monitoring">Connection Compression Monitoring</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h4 class="title"><a name="connection-compression-configuration"></a>Connection Compression Configuration</h4>

</div>

</div>

</div>
<p>
        As of MySQL 8.0.18, these configuration parameters are available
        for controlling connection compression:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable configures which compression algorithms the
            server permits for incoming connections.
          </p></li><li class="listitem"><p>
            The <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms</code></a>
            and <a class="link" href="programs.html#option_general_zstd-compression-level"><code class="option">--zstd-compression-level</code></a>
            command-line options configure permitted compression
            algorithms and <code class="literal">zstd</code> compression level for
            these client programs: <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>,
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>,
            <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a>, <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>,
            <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a>,
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>, <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>,
            <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a>, and
            <span class="command"><strong>mysqltest</strong></span>, and
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>. MySQL Shell also offers
            these command-line options from its 8.0.20 release.
          </p></li><li class="listitem"><p>
            The <code class="literal">MYSQL_OPT_COMPRESSION_ALGORITHMS</code> and
            <code class="literal">MYSQL_OPT_ZSTD_COMPRESSION_LEVEL</code> options
            for the <a class="link" href="connectors-apis.html#mysql-options" title="28.7.6.50 mysql_options()"><code class="literal">mysql_options()</code></a>
            function configure permitted compression algorithms and
            <code class="literal">zstd</code> compression level for client
            programs that use the MySQL C API.
          </p></li><li class="listitem"><p>
            The <code class="literal">MASTER_COMPRESSION_ALGORITHMS</code> and
            <code class="literal">MASTER_ZSTD_COMPRESSION_LEVEL</code> options for
            the <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a>
            statement configure permitted compression algorithms and
            <code class="literal">zstd</code> compression level for slave servers
            participating in master/slave replication.
          </p></li><li class="listitem"><p>
            The
            <a class="link" href="group-replication.html#sysvar_group_replication_recovery_compression_algorithm"><code class="literal">group_replication_recovery_compression_algorithm</code></a>
            and
            <a class="link" href="group-replication.html#sysvar_group_replication_recovery_zstd_compression_level"><code class="literal">group_replication_recovery_zstd_compression_level</code></a>
            system variables configure permitted compression algorithms
            and <code class="literal">zstd</code> compression level for Group
            Replication recovery connections when a new member joins a
            group and connects to a donor.
</p></li></ul>
</div>
<p>
        Configuration parameters that enable specifying compression
        algorithms are string-valued and take a list of one or more
        comma-separated compression algorithm names, in any order,
        chosen from the following items (not case-sensitive):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">zlib</code>: Permit connections that use the
            <code class="literal">zlib</code> compression algorithm.
          </p></li><li class="listitem"><p>
            <code class="literal">zstd</code>: Permit connections that use the
            <code class="literal">zstd</code> compression algorithm (zstd 1.3).
          </p></li><li class="listitem"><p>
            <code class="literal">uncompressed</code>: Permit uncompressed
            connections.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
          Because <code class="literal">uncompressed</code> is an algorithm name
          that may or may not be configured, it is possible to configure
          MySQL <span class="emphasis"><em>not</em></span> to support uncompressed
          connections.
</p>
</div>
<p>
        Examples:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            To configure which compression algorithms the server permits
            for incoming connections, set the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. By default, the server permits all
            available algorithms. To configure that setting explicitly
            at startup, use these lines in the server
            <code class="filename">my.cnf</code> file:
          </p><pre data-lang="ini" class="programlisting">[mysqld]
protocol_compression_algorithms=zlib,zstd,uncompressed</pre><p>
            To set and persist the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable to that value at runtime, use this
            statement:
          </p><pre data-lang="sql" class="programlisting">SET PERSIST protocol_compression_algorithms='zlib,zstd,uncompressed';</pre><p>
            <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
            PERSIST</code></a> sets the value for the running MySQL
            instance. It also saves the value, causing it to carry over
            to subsequent server restarts. To change the value for the
            running MySQL instance without having it carry over to
            subsequent restarts, use the <code class="literal">GLOBAL</code>
            keyword rather than <code class="literal">PERSIST</code>. See
            <a class="xref" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment">Section 13.7.6.1, “SET Syntax for Variable Assignment”</a>.
          </p></li><li class="listitem"><p>
            To permit only incoming connections that use
            <code class="literal">zstd</code> compression, configure the server at
            startup like this:
          </p><pre data-lang="ini" class="programlisting">[mysqld]
protocol_compression_algorithms=zstd</pre><p>
            Or, to make the change at runtime:
          </p><pre data-lang="sql" class="programlisting">SET PERSIST protocol_compression_algorithms='zstd';</pre></li><li class="listitem"><p>
            To permit the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client to initiate
            <code class="literal">zlib</code> or <code class="literal">uncompressed</code>
            connections, invoke it like this:
          </p><pre data-lang="terminal" class="programlisting">mysql --compression-algorithms=zlib,uncompressed</pre></li><li class="listitem"><p>
            To configure replication slaves to connect to the master
            using <code class="literal">zlib</code> or <code class="literal">zstd</code>
            connections, with a compression level of 7 for
            <code class="literal">zstd</code> connections, use a
            <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a> statement:
          </p><pre data-lang="sql" class="programlisting">CHANGE MASTER TO
  MASTER_COMPRESSION_ALGORITHMS = 'zlib,zstd',
  MASTER_ZSTD_COMPRESSION_LEVEL = 7;</pre><p>
            This assumes that the
            <a class="link" href="replication.html#sysvar_slave_compressed_protocol"><code class="literal">slave_compressed_protocol</code></a>
            system variable is disabled, for reasons described in
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
</p></li></ul>
</div>
<p>
        For successful connection setup, both sides of the connection
        must agree on which compression algorithm to use. The
        algorithm-negotiation process attempts to use
        <code class="literal">zlib</code>, then <code class="literal">zstd</code>, then
        <code class="literal">uncompressed</code>. If the two sides can find no
        common algorithm, the connection attempt fails.
      </p><p>
        Because both sides must agree on the compression algorithm, and
        because <code class="literal">uncompressed</code> is an algorithm value
        that need not be supported, fallback to an uncompressed
        connection does not necessarily occur. For example, if the
        server is configured to permit <code class="literal">zstd</code> and a
        client is configured to permit
        <code class="literal">zlib,uncompressed</code>, the client cannot connect
        at all. In this case, no algorithm is common to both sides, so
        connection attempts fail.
      </p><p>
        Configuration parameters that enable specifying the
        <code class="literal">zstd</code> compression level take an integer value
        from 1 to 22, with larger values indicating increasing levels of
        compression. The default <code class="literal">zstd</code> compression
        level is 3. The compression level setting has no effect on
        connections that do not use <code class="literal">zstd</code> compression.
      </p><p>
        A configurable <code class="literal">zstd</code> compression level enables
        choosing between less network traffic and higher CPU load versus
        more network traffic and lower CPU load. Higher compression
        levels reduce network congestion but the additional CPU load may
        reduce server performance.
</p>
</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="connection-compression-legacy-configuration"></a>Legacy Connection Compression Configuration</h4>

</div>

</div>

</div>
<p>
        Prior to MySQL 8.0.18, these configuration parameters are
        available for controlling connection compression:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Client programs support a
            <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a> command-line
            option to specify use of compression for the connection to
            the server.
          </p></li><li class="listitem"><p>
            For programs that use the MySQL C API, enabling the
            <code class="literal">MYSQL_OPT_COMPRESS</code> option for the
            <a class="link" href="connectors-apis.html#mysql-options" title="28.7.6.50 mysql_options()"><code class="literal">mysql_options()</code></a> function
            specifies use of compression for the connection to the
            server.
          </p></li><li class="listitem"><p>
            For master/server replication, enabling the
            <a class="link" href="replication.html#sysvar_slave_compressed_protocol"><code class="literal">slave_compressed_protocol</code></a>
            system variable specifies use of compression for slave
            connections to the master.
</p></li></ul>
</div>
<p>
        In each case, when use of compression is specified, the
        connection uses the <code class="literal">zlib</code> compression
        algorithm if both sides support it, with fallback to an
        uncompressed connection otherwise.
      </p><p>
        As of MySQL 8.0.18, the compression parameters just described
        become legacy parameters, due to the additional compression
        parameters introduced for more control over connection
        compression that are described in
        <a class="xref" href="programs.html#connection-compression-configuration" title="Connection Compression Configuration">Connection Compression Configuration</a>. An
        exception is MySQL Shell, where the
        <a class="ulink" href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysqlsh.html#option_mysqlsh_compress" target="_top"><code class="option">--compress</code></a> command-line option
        and <code class="literal">compression</code> parameter for URI-like string
        and key-value pair connection specifications remain current, and
        can be used to request compression without selecting compression
        algorithms. For information on MySQL Shell's connection
        compression control, see
        <a class="ulink" href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-compressed-connections.html" target="_top">Using Compressed Connections</a>.
      </p><p>
        The legacy compression parameters interact with the newer
        parameters and their semantics change as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The meaning of the legacy
            <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a> option depends on
            whether
            <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms</code></a> is
            specified:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                When
                <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms</code></a>
                is not specified,
                <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a> is equivalent
                to specifying a client-side algorithm set of
                <code class="literal">zlib,uncompressed</code>.
              </p></li><li class="listitem"><p>
                When
                <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms</code></a>
                is specified, <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a>
                is equivalent to specifying an algorithm set of
                <code class="literal">zlib</code> and the full client-side
                algorithm set is the union of <code class="literal">zlib</code>
                plus the algorithms specified by
                <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms</code></a>.
                For example, with both
                <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a> and
                <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms=zlib,zstd</code></a>,
                the permitted-algorithm set is <code class="literal">zlib</code>
                plus <code class="literal">zlib,zstd</code>; that is,
                <code class="literal">zlib,zstd</code>. With both
                <a class="link" href="programs.html#option_general_compress"><code class="option">--compress</code></a> and
                <a class="link" href="programs.html#option_general_compression-algorithms"><code class="option">--compression-algorithms=zstd,uncompressed</code></a>,
                the permitted-algorithm set is <code class="literal">zlib</code>
                plus <code class="literal">zstd,uncompressed</code>; that is,
                <code class="literal">zlib,zstd,uncompressed</code>.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            The same type of interaction occurs between the legacy
            <code class="literal">MYSQL_OPT_COMPRESS</code> option and the
            <code class="literal">MYSQL_OPT_COMPRESSION_ALGORITHMS</code> option
            for the <a class="link" href="connectors-apis.html#mysql-options" title="28.7.6.50 mysql_options()"><code class="literal">mysql_options()</code></a> C
            API function.
          </p></li><li class="listitem"><p>
            If the
            <a class="link" href="replication.html#sysvar_slave_compressed_protocol"><code class="literal">slave_compressed_protocol</code></a>
            system variable is enabled, it takes precedence over
            <code class="literal">MASTER_COMPRESSION_ALGORITHMS</code> and
            connections to the master use <code class="literal">zlib</code>
            compression if both master and slave support that algorithm.
            If
            <a class="link" href="replication.html#sysvar_slave_compressed_protocol"><code class="literal">slave_compressed_protocol</code></a>
            is disabled, the value of
            <code class="literal">MASTER_COMPRESSION_ALGORITHMS</code> applies.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
          The legacy compression-control parameters are deprecated as of
          MySQL 8.0.18 and will be removed in a future MySQL version.
</p>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h4 class="title"><a name="connection-compression-monitoring"></a>Connection Compression Monitoring</h4>

</div>

</div>

</div>
<p>
        The <a class="link" href="server-administration.html#statvar_Compression"><code class="literal">Compression</code></a> status
        variable is <code class="literal">ON</code> or <code class="literal">OFF</code> to
        indicate whether the current connection uses compression.
      </p><p>
        The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client <code class="literal">\status</code>
        command displays a line that says <code class="literal">Protocol:
        Compressed</code> if compression is enabled for the current
        connection. If that line is not present, the connection is
        uncompressed.
      </p><p>
        As of 8.0.14, the MySQL Shell <code class="literal">\status</code>
        command displays a <code class="literal">Compression:</code> line that
        says <code class="literal">Disabled</code> or <code class="literal">Enabled</code>
        to indicate whether the connection is compressed.
      </p><p>
        As of MySQL 8.0.18, these additional sources of information are
        available for monitoring connection compression:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            To monitor compression in use for client connections, use
            the <a class="link" href="server-administration.html#statvar_Compression_algorithm"><code class="literal">Compression_algorithm</code></a>
            and <a class="link" href="server-administration.html#statvar_Compression_level"><code class="literal">Compression_level</code></a>
            status variables. For the current connection, their values
            indicate the compression algorithm and compression level,
            respectively.
          </p></li><li class="listitem"><p>
            To determine which compression algorithms the server is
            configured to permit for incoming connections, check the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable.
          </p></li><li class="listitem"><p>
            For master/slave replication connections, the configured
            compression algorithms and compression level are available
            from multiple sources:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                The Performance Schema
                <a class="link" href="performance-schema.html#replication-connection-configuration-table" title="26.12.11.1 The replication_connection_configuration Table"><code class="literal">replication_connection_configuration</code></a>
                table has <code class="literal">COMPRESSION_ALGORITHMS</code> and
                <code class="literal">ZSTD_COMPRESSION_LEVEL</code> columns.
              </p></li><li class="listitem"><p>
                The <code class="literal">mysql.slave_master_info</code> system
                table has
                <code class="literal">Master_compression_algorithms</code> and
                <code class="literal">Master_zstd_compression_level</code>
                columns. If the <code class="filename">master.info</code> file
                exists, it contains lines for those values as well.
</p></li></ul>
</div>
</li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="setting-environment-variables"></a>4.2.7 Setting Environment Variables</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433104256"></a><p>
      Environment variables can be set at the command prompt to affect
      the current invocation of your command processor, or set
      permanently to affect future invocations. To set a variable
      permanently, you can set it in a startup file or by using the
      interface provided by your system for this purpose. Consult the
      documentation for your command interpreter for specific details.
      <a class="xref" href="programs.html#environment-variables" title="4.9 Environment Variables">Section 4.9, “Environment Variables”</a>, lists all environment
      variables that affect MySQL program operation.
    </p><p>
      To specify a value for an environment variable, use the syntax
      appropriate for your command processor. For example, on Windows,
      you can set the <code class="literal">USER</code> variable to specify your
      MySQL account name. To do so, use this syntax:
    </p><pre data-lang="terminal" class="programlisting">SET USER=<em class="replaceable"><code>your_name</code></em>
</pre><p>
      The syntax on Unix depends on your shell. Suppose that you want to
      specify the TCP/IP port number using the
      <code class="literal">MYSQL_TCP_PORT</code> variable. Typical syntax (such
      as for <span class="command"><strong>sh</strong></span>, <span class="command"><strong>ksh</strong></span>,
      <span class="command"><strong>bash</strong></span>, <span class="command"><strong>zsh</strong></span>, and so on) is as
      follows:
    </p><pre data-lang="terminal" class="programlisting">MYSQL_TCP_PORT=3306
export MYSQL_TCP_PORT</pre><p>
      The first command sets the variable, and the
      <code class="literal">export</code> command exports the variable to the
      shell environment so that its value becomes accessible to MySQL
      and other processes.
    </p><p>
      For <span class="command"><strong>csh</strong></span> and <span class="command"><strong>tcsh</strong></span>, use
      <span class="command"><strong>setenv</strong></span> to make the shell variable available to
      the environment:
    </p><pre data-lang="terminal" class="programlisting">setenv MYSQL_TCP_PORT 3306</pre><p>
      The commands to set environment variables can be executed at your
      command prompt to take effect immediately, but the settings
      persist only until you log out. To have the settings take effect
      each time you log in, use the interface provided by your system or
      place the appropriate command or commands in a startup file that
      your command interpreter reads each time it starts.
    </p><p>
      On Windows, you can set environment variables using the System
      Control Panel (under Advanced).
    </p><p>
      On Unix, typical shell startup files are
      <code class="filename">.bashrc</code> or <code class="filename">.bash_profile</code>
      for <span class="command"><strong>bash</strong></span>, or <code class="filename">.tcshrc</code> for
      <span class="command"><strong>tcsh</strong></span>.
    </p><p>
      Suppose that your MySQL programs are installed in
      <code class="literal">/usr/local/mysql/bin</code> and that you want to make
      it easy to invoke these programs. To do this, set the value of the
      <code class="literal">PATH</code> environment variable to include that
      directory. For example, if your shell is <span class="command"><strong>bash</strong></span>,
      add the following line to your <code class="filename">.bashrc</code> file:
    </p><pre data-lang="terminal" class="programlisting">PATH=${PATH}:/usr/local/mysql/bin</pre><p>
      <span class="command"><strong>bash</strong></span> uses different startup files for login and
      nonlogin shells, so you might want to add the setting to
      <code class="filename">.bashrc</code> for login shells and to
      <code class="filename">.bash_profile</code> for nonlogin shells to make
      sure that <code class="literal">PATH</code> is set regardless.
    </p><p>
      If your shell is <span class="command"><strong>tcsh</strong></span>, add the following line
      to your <code class="filename">.tcshrc</code> file:
    </p><pre data-lang="terminal" class="programlisting">setenv PATH ${PATH}:/usr/local/mysql/bin</pre><p>
      If the appropriate startup file does not exist in your home
      directory, create it with a text editor.
    </p><p>
      After modifying your <code class="literal">PATH</code> setting, open a new
      console window on Windows or log in again on Unix so that the
      setting goes into effect.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-server"></a>4.3 Server and Server-Startup Programs</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#mysqld">4.3.1 <span class="command"><strong>mysqld</strong></span> — The MySQL Server</a></span></dt><dt><span class="section"><a href="programs.html#mysqld-safe">4.3.2 <span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script</a></span></dt><dt><span class="section"><a href="programs.html#mysql-server">4.3.3 <span class="command"><strong>mysql.server</strong></span> — MySQL Server Startup Script</a></span></dt><dt><span class="section"><a href="programs.html#mysqld-multi">4.3.4 <span class="command"><strong>mysqld_multi</strong></span> — Manage Multiple MySQL Servers</a></span></dt></dl>
</div>
<p>
    This section describes <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, the MySQL server,
    and several programs that are used to start the server.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqld"></a>4.3.1 <span class="command"><strong>mysqld</strong></span> — The MySQL Server</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46444433066352"></a><a class="indexterm" name="idm46444433064992"></a><p>
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, also known as MySQL Server, is the
        main program that does most of the work in a MySQL installation.
        MySQL Server manages access to the MySQL data directory that
        contains databases and tables. The data directory is also the
        default location for other information such as log files and
        status files.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Some installation packages contain a debugging version of the
          server named <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld-debug</strong></span></a>. Invoke this
          version instead of <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> for debugging
          support, memory allocation checking, and trace file support
          (see <a class="xref" href="extending-mysql.html#making-trace-files" title="29.5.1.2 Creating Trace Files">Section 29.5.1.2, “Creating Trace Files”</a>).
</p>
</div>
<p>
        When MySQL server starts, it listens for network connections
        from client programs and manages access to databases on behalf
        of those clients.
      </p><p>
        The <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> program has many options that can
        be specified at startup. For a complete list of options, run
        this command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld --verbose --help</code></strong>
</pre><p>
        MySQL Server also has a set of system variables that affect its
        operation as it runs. System variables can be set at server
        startup, and many of them can be changed at runtime to effect
        dynamic server reconfiguration. MySQL Server also has a set of
        status variables that provide information about its operation.
        You can monitor these status variables to access runtime
        performance characteristics.
      </p><p>
        For a full description of MySQL Server command options, system
        variables, and status variables, see
        <a class="xref" href="server-administration.html#mysqld-server" title="5.1 The MySQL Server">Section 5.1, “The MySQL Server”</a>. For information about
        installing MySQL and setting up the initial configuration, see
        <a class="xref" href="installing.html" title="Chapter 2 Installing and Upgrading MySQL">Chapter 2, <i>Installing and Upgrading MySQL</i></a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqld-safe"></a>4.3.2 <span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444433048624"></a><a class="indexterm" name="idm46444433047680"></a><a class="indexterm" name="idm46444433046320"></a><p>
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is the recommended way to start a
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server on Unix.
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> adds some safety features such as
        restarting the server when an error occurs and logging runtime
        information to an error log. A description of error logging is
        given later in this section.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          For some Linux platforms, MySQL installation from RPM or
          Debian packages includes systemd support for managing MySQL
          server startup and shutdown. On these platforms,
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is not installed because it is
          unnecessary. For more information, see
          <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
</p>
</div>
<p>
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> tries to start an executable
        named <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. To override the default
        behavior and specify explicitly the name of the server you want
        to run, specify a <a class="link" href="programs.html#option_mysqld_safe_mysqld"><code class="option">--mysqld</code></a>
        or <a class="link" href="programs.html#option_mysqld_safe_mysqld-version"><code class="option">--mysqld-version</code></a> option
        to <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. You can also use
        <a class="link" href="programs.html#option_mysqld_safe_ledir"><code class="option">--ledir</code></a> to indicate the
        directory where <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> should look for
        the server.
      </p><p>
        Many of the options to <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> are the
        same as the options to <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. See
        <a class="xref" href="server-administration.html#server-options" title="5.1.7 Server Command Options">Section 5.1.7, “Server Command Options”</a>.
      </p><p>
        Options unknown to <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> are passed to
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> if they are specified on the command
        line, but ignored if they are specified in the
        <code class="literal">[mysqld_safe]</code> group of an option file. See
        <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
      </p><p>
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> reads all options from the
        <code class="literal">[mysqld]</code>, <code class="literal">[server]</code>, and
        <code class="literal">[mysqld_safe]</code> sections in option files. For
        example, if you specify a <code class="literal">[mysqld]</code> section
        like this, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> will find and use the
        <a class="link" href="programs.html#option_mysqld_safe_log-error"><code class="option">--log-error</code></a> option:
      </p><pre data-lang="ini" class="programlisting">[mysqld]
log-error=error.log</pre><p>
        For backward compatibility, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> also
        reads <code class="literal">[safe_mysqld]</code> sections, but to be
        current you should rename such sections to
        <code class="literal">[mysqld_safe]</code>.
      </p><p>
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> accepts options on the command
        line and in option files, as described in the following table.
        For information about option files used by MySQL programs, see
        <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444433007744"></a><p class="title"><b>Table 4.6 mysqld_safe Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqld_safe."><col width="35%"><col width="64%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_basedir">--basedir</a></td>
<td>Path to MySQL installation directory</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_core-file-size">--core-file-size</a></td>
<td>Size of core file that mysqld should be able to create</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_datadir">--datadir</a></td>
<td>Path to data directory</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_help">--help</a></td>
<td>Display help message and exit</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_ledir">--ledir</a></td>
<td>Path to directory where server is located</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_log-error">--log-error</a></td>
<td>Write error log to named file</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_malloc-lib">--malloc-lib</a></td>
<td>Alternative malloc library to use for mysqld</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_mysqld">--mysqld</a></td>
<td>Name of server program to start (in ledir directory)</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_mysqld-safe-log-timestamps">--mysqld-safe-log-timestamps</a></td>
<td>Timestamp format for logging</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_mysqld-version">--mysqld-version</a></td>
<td>Suffix for server program name</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_nice">--nice</a></td>
<td>Use nice program to set server scheduling priority</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_open-files-limit">--open-files-limit</a></td>
<td>Number of files that mysqld should be able to open</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_pid-file">--pid-file</a></td>
<td>Path name of server process ID file</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_port">--port</a></td>
<td>Port number on which to listen for TCP/IP connections</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_skip-kill-mysqld">--skip-kill-mysqld</a></td>
<td>Do not try to kill stray mysqld processes</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_syslog">--skip-syslog</a></td>
<td>Do not write error messages to syslog; use error log file</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_socket">--socket</a></td>
<td>Socket file on which to listen for Unix socket connections</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_syslog">--syslog</a></td>
<td>Write error messages to syslog</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_syslog-tag">--syslog-tag</a></td>
<td>Tag suffix for messages written to syslog</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_timezone">--timezone</a></td>
<td>Set TZ time zone environment variable to named value</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqld_safe_user">--user</a></td>
<td>Run mysqld as user having name user_name or numeric user ID user_id</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqld_safe_help"></a>
            <a class="indexterm" name="idm46444432926896"></a>

            <a class="indexterm" name="idm46444432925440"></a>

            <a class="link" href="programs.html#option_mysqld_safe_help"><code class="option">--help</code></a>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_basedir"></a>
            <a class="indexterm" name="idm46444432921280"></a>

            <a class="indexterm" name="idm46444432919792"></a>

            <a class="link" href="programs.html#option_mysqld_safe_basedir"><code class="option">--basedir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The path to the MySQL installation directory.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_core-file-size"></a>
            <a class="indexterm" name="idm46444432915360"></a>

            <a class="indexterm" name="idm46444432913872"></a>

            <a class="link" href="programs.html#option_mysqld_safe_core-file-size"><code class="option">--core-file-size=<em class="replaceable"><code>size</code></em></code></a>
          </p><p>
            The size of the core file that <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            should be able to create. The option value is passed to
            <span class="command"><strong>ulimit -c</strong></span>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              The
              <a class="link" href="innodb-storage-engine.html#sysvar_innodb_buffer_pool_in_core_file"><code class="literal">innodb_buffer_pool_in_core_file</code></a>
              variable can be used to reduce the size of core files on
              operating systems that support it. For more information,
              see <a class="xref" href="innodb-storage-engine.html#innodb-buffer-pool-in-core-file" title="15.8.3.7 Excluding Buffer Pool Pages from Core Files">Section 15.8.3.7, “Excluding Buffer Pool Pages from Core Files”</a>.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqld_safe_datadir"></a>
            <a class="indexterm" name="idm46444432904496"></a>

            <a class="indexterm" name="idm46444432903008"></a>

            <a class="link" href="programs.html#option_mysqld_safe_datadir"><code class="option">--datadir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The path to the data directory.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444432898592"></a>

            <a class="indexterm" name="idm46444432897136"></a>

            <a class="link" href="programs.html#option_mysqld_safe_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file in addition to the usual option files.
            If the file does not exist or is otherwise inaccessible, the
            server will exit with an error.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name. This must be the first option
            on the command line if it is used.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_defaults-file"></a>
            <a class="indexterm" name="idm46444432890608"></a>

            <a class="indexterm" name="idm46444432889120"></a>

            <a class="link" href="programs.html#option_mysqld_safe_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, the server will exit with an
            error. <em class="replaceable"><code>file_name</code></em> is interpreted
            relative to the current directory if given as a relative
            path name rather than a full path name. This must be the
            first option on the command line if it is used.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_ledir"></a>
            <a class="indexterm" name="idm46444432882832"></a>

            <a class="indexterm" name="idm46444432881344"></a>

            <a class="link" href="programs.html#option_mysqld_safe_ledir"><code class="option">--ledir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            If <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> cannot find the server,
            use this option to indicate the path name to the directory
            where the server is located.
          </p><p>
            This option is accepted only on the command line, not in
            option files. On platforms that use systemd, the value can
            be specified in the value of <code class="literal">MYSQLD_OPTS</code>.
            See <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_log-error"></a>
            <a class="indexterm" name="idm46444432873632"></a>

            <a class="indexterm" name="idm46444432872144"></a>

            <a class="link" href="programs.html#option_mysqld_safe_log-error"><code class="option">--log-error=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Write the error log to the given file. See
            <a class="xref" href="server-administration.html#error-log" title="5.4.2 The Error Log">Section 5.4.2, “The Error Log”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_mysqld-safe-log-timestamps"></a>
            <a class="indexterm" name="idm46444432866992"></a>

            <a class="indexterm" name="idm46444432865488"></a>

            <a class="link" href="programs.html#option_mysqld_safe_mysqld-safe-log-timestamps"><code class="option">--mysqld-safe-log-timestamps</code></a>
          </p><p>
            This option controls the format for timestamps in log output
            produced by <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. The following
            list describes the permitted values. For any other value,
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> logs a warning and uses
            <code class="literal">UTC</code> format.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">UTC</code>, <code class="literal">utc</code>
              </p><p>
                ISO 8601 UTC format (same as
                <a class="link" href="server-administration.html#sysvar_log_timestamps"><code class="option">--log_timestamps=UTC</code></a> for
                the server). This is the default.
              </p></li><li class="listitem"><p>
                <code class="literal">SYSTEM</code>, <code class="literal">system</code>
              </p><p>
                ISO 8601 local time format (same as
                <a class="link" href="server-administration.html#sysvar_log_timestamps"><code class="option">--log_timestamps=SYSTEM</code></a>
                for the server).
              </p></li><li class="listitem"><p>
                <code class="literal">HYPHEN</code>, <code class="literal">hyphen</code>
              </p><p>
                <em class="replaceable"><code>YY-MM-DD h:mm:ss</code></em> format, as
                in <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> for MySQL 5.6.
              </p></li><li class="listitem"><p>
                <code class="literal">LEGACY</code>, <code class="literal">legacy</code>
              </p><p>
                <em class="replaceable"><code>YYMMDD hh:mm:ss</code></em> format, as in
                <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> prior to MySQL 5.6.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_mysqld_safe_malloc-lib"></a>
            <a class="indexterm" name="idm46444432841728"></a>

            <a class="indexterm" name="idm46444432840240"></a>

            <a class="link" href="programs.html#option_mysqld_safe_malloc-lib"><code class="option">--malloc-lib=[<em class="replaceable"><code>lib_name</code></em>]</code></a>
          </p><a class="indexterm" name="idm46444432837248"></a><a class="indexterm" name="idm46444432836208"></a><p>
            The name of the library to use for memory allocation instead
            of the system <code class="literal">malloc()</code> library. The
            option value must be one of the directories
            <code class="filename">/usr/lib</code>,
            <code class="filename">/usr/lib64</code>,
            <code class="filename">/usr/lib/i386-linux-gnu</code>, or
            <code class="filename">/usr/lib/x86_64-linux-gnu</code>.
          </p><p>
            The <a class="link" href="programs.html#option_mysqld_safe_malloc-lib"><code class="option">--malloc-lib</code></a> option
            works by modifying the <code class="literal">LD_PRELOAD</code>
            environment value to affect dynamic linking to enable the
            loader to find the memory-allocation library when
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> runs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                If the option is not given, or is given without a value
                (<a class="link" href="programs.html#option_mysqld_safe_malloc-lib"><code class="option">--malloc-lib=</code></a>),
                <code class="literal">LD_PRELOAD</code> is not modified and no
                attempt is made to use <code class="literal">tcmalloc</code>.
              </p></li><li class="listitem"><p>
                If the option is given as
                <a class="link" href="programs.html#option_mysqld_safe_malloc-lib"><code class="option">--malloc-lib=tcmalloc</code></a>,
                <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> looks for a
                <code class="literal">tcmalloc</code> library in
                <code class="filename">/usr/lib</code>. If
                <code class="literal">tmalloc</code> is found, its path name is
                added to the beginning of the
                <code class="literal">LD_PRELOAD</code> value for
                <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. If
                <code class="literal">tcmalloc</code> is not found,
                <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> aborts with an error.
              </p></li><li class="listitem"><p>
                If the option is given as
                <a class="link" href="programs.html#option_mysqld_safe_malloc-lib"><code class="option">--malloc-lib=<em class="replaceable"><code>/path/to/some/library</code></em></code></a>,
                that full path is added to the beginning of the
                <code class="literal">LD_PRELOAD</code> value. If the full path
                points to a nonexistent or unreadable file,
                <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> aborts with an error.
              </p></li><li class="listitem"><p>
                For cases where <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> adds a
                path name to <code class="literal">LD_PRELOAD</code>, it adds the
                path to the beginning of any existing value the variable
                already has.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              On systems that manage the server using systemd,
              <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is not available. Instead,
              specify the allocation library by setting
              <code class="literal">LD_PRELOAD</code> in
              <code class="filename">/etc/sysconfig/mysql</code>.
</p>
</div>
<p>
            Linux users can use the
            <code class="filename">libtcmalloc_minimal.so</code> library on any
            platform for which a <code class="literal">tcmalloc</code> package is
            installed in <code class="filename">/usr/lib</code> by adding these
            lines to the <code class="filename">my.cnf</code> file:
          </p><pre data-lang="ini" class="programlisting">[mysqld_safe]
malloc-lib=tcmalloc</pre><p>
            To use a specific <code class="literal">tcmalloc</code> library,
            specify its full path name. Example:
          </p><pre data-lang="ini" class="programlisting">[mysqld_safe]
malloc-lib=/opt/lib/libtcmalloc_minimal.so</pre></li><li class="listitem"><p><a name="option_mysqld_safe_mysqld"></a>
            <a class="indexterm" name="idm46444432795536"></a>

            <a class="indexterm" name="idm46444432794048"></a>

            <a class="link" href="programs.html#option_mysqld_safe_mysqld"><code class="option">--mysqld=<em class="replaceable"><code>prog_name</code></em></code></a>
          </p><p>
            The name of the server program (in the
            <code class="literal">ledir</code> directory) that you want to start.
            This option is needed if you use the MySQL binary
            distribution but have the data directory outside of the
            binary distribution. If <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>
            cannot find the server, use the
            <a class="link" href="programs.html#option_mysqld_safe_ledir"><code class="option">--ledir</code></a> option to
            indicate the path name to the directory where the server is
            located.
          </p><p>
            This option is accepted only on the command line, not in
            option files. On platforms that use systemd, the value can
            be specified in the value of <code class="literal">MYSQLD_OPTS</code>.
            See <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_mysqld-version"></a>
            <a class="indexterm" name="idm46444432784368"></a>

            <a class="indexterm" name="idm46444432782880"></a>

            <a class="link" href="programs.html#option_mysqld_safe_mysqld-version"><code class="option">--mysqld-version=<em class="replaceable"><code>suffix</code></em></code></a>
          </p><p>
            This option is similar to the
            <a class="link" href="programs.html#option_mysqld_safe_mysqld"><code class="option">--mysqld</code></a> option, but you
            specify only the suffix for the server program name. The
            base name is assumed to be <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. For
            example, if you use
            <a class="link" href="programs.html#option_mysqld_safe_mysqld-version"><code class="option">--mysqld-version=debug</code></a>,
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> starts the
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld-debug</strong></span></a> program in the
            <code class="literal">ledir</code> directory. If the argument to
            <a class="link" href="programs.html#option_mysqld_safe_mysqld-version"><code class="option">--mysqld-version</code></a> is
            empty, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> uses
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> in the <code class="literal">ledir</code>
            directory.
          </p><p>
            This option is accepted only on the command line, not in
            option files. On platforms that use systemd, the value can
            be specified in the value of <code class="literal">MYSQLD_OPTS</code>.
            See <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_nice"></a>
            <a class="indexterm" name="idm46444432765744"></a>

            <a class="indexterm" name="idm46444432764288"></a>

            <a class="link" href="programs.html#option_mysqld_safe_nice"><code class="option">--nice=<em class="replaceable"><code>priority</code></em></code></a>
          </p><p>
            Use the <code class="literal">nice</code> program to set the server's
            scheduling priority to the given value.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_no-defaults"></a>
            <a class="indexterm" name="idm46444432759088"></a>

            <a class="indexterm" name="idm46444432757600"></a>

            <a class="link" href="programs.html#option_mysqld_safe_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqld_safe_no-defaults"><code class="option">--no-defaults</code></a> can be
            used to prevent them from being read. This must be the first
            option on the command line if it is used.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_open-files-limit"></a>
            <a class="indexterm" name="idm46444432751088"></a>

            <a class="indexterm" name="idm46444432749600"></a>

            <a class="link" href="programs.html#option_mysqld_safe_open-files-limit"><code class="option">--open-files-limit=<em class="replaceable"><code>count</code></em></code></a>
          </p><p>
            The number of files that <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> should be
            able to open. The option value is passed to <span class="command"><strong>ulimit
            -n</strong></span>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              You must start <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> as
              <code class="literal">root</code> for this to function properly.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqld_safe_pid-file"></a>
            <a class="indexterm" name="idm46444432740400"></a>

            <a class="indexterm" name="idm46444432738912"></a>

            <a class="link" href="programs.html#option_mysqld_safe_pid-file"><code class="option">--pid-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name that <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> should use for
            its process ID file.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_plugin-dir"></a>
            <a class="indexterm" name="idm46444432733296"></a>

            <a class="indexterm" name="idm46444432731808"></a>

            <a class="link" href="programs.html#option_mysqld_safe_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The path name of the plugin directory.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_port"></a>
            <a class="indexterm" name="idm46444432727376"></a>

            <a class="indexterm" name="idm46444432725920"></a>

            <a class="indexterm" name="idm46444432724432"></a>

            <a class="link" href="programs.html#option_mysqld_safe_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>
          </p><p>
            The port number that the server should use when listening
            for TCP/IP connections. The port number must be 1024 or
            higher unless the server is started by the
            <code class="literal">root</code> operating system user.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_skip-kill-mysqld"></a>
            <a class="indexterm" name="idm46444432719568"></a>

            <a class="indexterm" name="idm46444432718080"></a>

            <a class="link" href="programs.html#option_mysqld_safe_skip-kill-mysqld"><code class="option">--skip-kill-mysqld</code></a>
          </p><p>
            Do not try to kill stray <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> processes
            at startup. This option works only on Linux.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_socket"></a>
            <a class="indexterm" name="idm46444432712672"></a>

            <a class="indexterm" name="idm46444432711184"></a>

            <a class="link" href="programs.html#option_mysqld_safe_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>
          </p><p>
            The Unix socket file that the server should use when
            listening for local connections.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_syslog"></a>
            <a class="indexterm" name="idm46444432706688"></a>

            <a class="indexterm" name="idm46444432705200"></a>

            <a class="indexterm" name="idm46444432703712"></a>

            <a class="indexterm" name="idm46444432702224"></a>

            <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--syslog</code></a>,
            <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--skip-syslog</code></a>
          </p><p>
            <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--syslog</code></a> causes error
            messages to be sent to <code class="literal">syslog</code> on systems
            that support the <span class="command"><strong>logger</strong></span> program.
            <code class="literal">--skip-syslog</code> suppresses the use of
            <code class="literal">syslog</code>; messages are written to an error
            log file.
          </p><p>
            When <code class="literal">syslog</code> is used for error logging,
            the <code class="literal">daemon.err</code> facility/severity is used
            for all log messages.
          </p><p>
            Using these options to control <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            logging is deprecated. To write error log output to the
            system log, use the instructions at
            <a class="xref" href="server-administration.html#error-log-syslog" title="5.4.2.7 Error Logging to the System Log">Section 5.4.2.7, “Error Logging to the System Log”</a>. To control the facility,
            use the server
            <a class="link" href="server-administration.html#sysvar_log_syslog_facility"><code class="literal">log_syslog_facility</code></a> system
            variable.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_syslog-tag"></a>
            <a class="indexterm" name="idm46444432687424"></a>

            <a class="indexterm" name="idm46444432685936"></a>

            <a class="link" href="programs.html#option_mysqld_safe_syslog-tag"><code class="option">--syslog-tag=<em class="replaceable"><code>tag</code></em></code></a>
          </p><p>
            For logging to <code class="literal">syslog</code>, messages from
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> and <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            are written with identifiers of
            <code class="literal">mysqld_safe</code> and
            <code class="literal">mysqld</code>, respectively. To specify a suffix
            for the identifiers, use
            <a class="link" href="programs.html#option_mysqld_safe_syslog-tag"><code class="option">--syslog-tag=<em class="replaceable"><code>tag</code></em></code></a>,
            which modifies the identifiers to be
            <code class="literal">mysqld_safe-<em class="replaceable"><code>tag</code></em></code>
            and
            <code class="literal">mysqld-<em class="replaceable"><code>tag</code></em></code>.
          </p><p>
            Using this option to control <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            logging is deprecated. Use the server
            <a class="link" href="server-administration.html#sysvar_log_syslog_tag"><code class="literal">log_syslog_tag</code></a> system
            variable instead. See <a class="xref" href="server-administration.html#error-log-syslog" title="5.4.2.7 Error Logging to the System Log">Section 5.4.2.7, “Error Logging to the System Log”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_timezone"></a>
            <a class="indexterm" name="idm46444432669888"></a>

            <a class="indexterm" name="idm46444432668400"></a>

            <a class="link" href="programs.html#option_mysqld_safe_timezone"><code class="option">--timezone=<em class="replaceable"><code>timezone</code></em></code></a>
          </p><p>
            Set the <code class="literal">TZ</code> time zone environment variable
            to the given option value. Consult your operating system
            documentation for legal time zone specification formats.
          </p></li><li class="listitem"><p><a name="option_mysqld_safe_user"></a>
            <a class="indexterm" name="idm46444432663168"></a>

            <a class="indexterm" name="idm46444432661712"></a>

            <a class="link" href="programs.html#option_mysqld_safe_user"><code class="option">--user={<em class="replaceable"><code>user_name</code></em>|<em class="replaceable"><code>user_id</code></em>}</code></a>
          </p><p>
            Run the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server as the user having
            the name <em class="replaceable"><code>user_name</code></em> or the numeric
            user ID <em class="replaceable"><code>user_id</code></em>.
            (<span class="quote">“<span class="quote">User</span>”</span> in this context refers to a system
            login account, not a MySQL user listed in the grant tables.)
</p></li></ul>
</div>
<p>
        If you execute <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> with the
        <a class="link" href="programs.html#option_mysqld_safe_defaults-file"><code class="option">--defaults-file</code></a> or
        <a class="link" href="programs.html#option_mysqld_safe_defaults-extra-file"><code class="option">--defaults-extra-file</code></a> option
        to name an option file, the option must be the first one given
        on the command line or the option file will not be used. For
        example, this command will not use the named option file:
      </p><pre data-lang="terminal" class="programlisting">mysql&gt; <strong class="userinput"><code>mysqld_safe --port=<em class="replaceable"><code>port_num</code></em> --defaults-file=<em class="replaceable"><code>file_name</code></em></code></strong>
</pre><p>
        Instead, use the following command:
      </p><pre data-lang="terminal" class="programlisting">mysql&gt; <strong class="userinput"><code>mysqld_safe --defaults-file=<em class="replaceable"><code>file_name</code></em> --port=<em class="replaceable"><code>port_num</code></em></code></strong>
</pre><p>
        The <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> script is written so that it
        normally can start a server that was installed from either a
        source or a binary distribution of MySQL, even though these
        types of distributions typically install the server in slightly
        different locations. (See
        <a class="xref" href="installing.html#installation-layouts" title="2.1.4 Installation Layouts">Section 2.1.4, “Installation Layouts”</a>.)
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> expects one of the following
        conditions to be true:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The server and databases can be found relative to the
            working directory (the directory from which
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is invoked). For binary
            distributions, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> looks under
            its working directory for <code class="filename">bin</code> and
            <code class="filename">data</code> directories. For source
            distributions, it looks for <code class="filename">libexec</code> and
            <code class="filename">var</code> directories. This condition should
            be met if you execute <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> from
            your MySQL installation directory (for example,
            <code class="filename">/usr/local/mysql</code> for a binary
            distribution).
          </p></li><li class="listitem"><p>
            If the server and databases cannot be found relative to the
            working directory, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> attempts
            to locate them by absolute path names. Typical locations are
            <code class="filename">/usr/local/libexec</code> and
            <code class="filename">/usr/local/var</code>. The actual locations
            are determined from the values configured into the
            distribution at the time it was built. They should be
            correct if MySQL is installed in the location specified at
            configuration time.
</p></li></ul>
</div>
<p>
        Because <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> tries to find the server
        and databases relative to its own working directory, you can
        install a binary distribution of MySQL anywhere, as long as you
        run <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> from the MySQL installation
        directory:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>cd <em class="replaceable"><code>mysql_installation_directory</code></em></code></strong>
shell&gt; <strong class="userinput"><code>bin/mysqld_safe &amp;</code></strong>
</pre><p>
        If <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> fails, even when invoked from
        the MySQL installation directory, specify the
        <a class="link" href="programs.html#option_mysqld_safe_ledir"><code class="option">--ledir</code></a> and
        <a class="link" href="programs.html#option_mysqld_safe_datadir"><code class="option">--datadir</code></a> options to
        indicate the directories in which the server and databases are
        located on your system.
      </p><p>
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> tries to use the
        <span class="command"><strong>sleep</strong></span> and <span class="command"><strong>date</strong></span> system
        utilities to determine how many times per second it has
        attempted to start. If these utilities are present and the
        attempted starts per second is greater than 5,
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> waits 1 full second before
        starting again. This is intended to prevent excessive CPU usage
        in the event of repeated failures. (Bug #11761530, Bug #54035)
      </p><p>
        When you use <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> to start
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>
        arranges for error (and notice) messages from itself and from
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to go to the same destination.
      </p><p>
        There are several <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> options for
        controlling the destination of these messages:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqld_safe_log-error"><code class="option">--log-error=<em class="replaceable"><code>file_name</code></em></code></a>:
            Write error messages to the named error file.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--syslog</code></a>: Write error
            messages to <code class="literal">syslog</code> on systems that
            support the <span class="command"><strong>logger</strong></span> program.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--skip-syslog</code></a>:
            Do not write error messages to <code class="literal">syslog</code>.
            Messages are written to the default error log file
            (<code class="filename"><em class="replaceable"><code>host_name</code></em>.err</code>
            in the data directory), or to a named file if the
            <a class="link" href="programs.html#option_mysqld_safe_log-error"><code class="option">--log-error</code></a> option is
            given.
</p></li></ul>
</div>
<p>
        If none of these options is given, the default is
        <a class="link" href="programs.html#option_mysqld_safe_syslog"><code class="option">--skip-syslog</code></a>.
      </p><p>
        When <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> writes a message, notices go
        to the logging destination (<code class="literal">syslog</code> or the
        error log file) and <code class="literal">stdout</code>. Errors go to the
        logging destination and <code class="literal">stderr</code>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Controlling <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> logging from
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> is deprecated. Use the server's
          native <code class="literal">syslog</code> support instead. For more
          information, see <a class="xref" href="server-administration.html#error-log-syslog" title="5.4.2.7 Error Logging to the System Log">Section 5.4.2.7, “Error Logging to the System Log”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-server"></a>4.3.3 <span class="command"><strong>mysql.server</strong></span> — MySQL Server Startup Script</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444432585632"></a><p>
        MySQL distributions on Unix and Unix-like system include a
        script named <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a>, which starts the
        MySQL server using <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. It can be
        used on systems such as Linux and Solaris that use System
        V-style run directories to start and stop system services. It is
        also used by the macOS Startup Item for MySQL.
      </p><p>
        <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> is the script name as used
        within the MySQL source tree. The installed name might be
        different (for example, <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> or
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>). In the following discussion, adjust
        the name <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> as appropriate for your
        system.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          For some Linux platforms, MySQL installation from RPM or
          Debian packages includes systemd support for managing MySQL
          server startup and shutdown. On these platforms,
          <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> and
          <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> are not installed because they
          are unnecessary. For more information, see
          <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
</p>
</div>
<p>
        To start or stop the server manually using the
        <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> script, invoke it from the
        command line with <code class="literal">start</code> or
        <code class="literal">stop</code> arguments:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql.server start</code></strong>
shell&gt; <strong class="userinput"><code>mysql.server stop</code></strong>
</pre><p>
        <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> changes location to the MySQL
        installation directory, then invokes
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. To run the server as some
        specific user, add an appropriate <code class="literal">user</code> option
        to the <code class="literal">[mysqld]</code> group of the global
        <code class="filename">/etc/my.cnf</code> option file, as shown later in
        this section. (It is possible that you must edit
        <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> if you've installed a binary
        distribution of MySQL in a nonstandard location. Modify it to
        change location into the proper directory before it runs
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. If you do this, your modified
        version of <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> may be overwritten if
        you upgrade MySQL in the future; make a copy of your edited
        version that you can reinstall.)
      </p><p>
        <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server stop</strong></span></a> stops the server by sending
        a signal to it. You can also stop the server manually by
        executing <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin shutdown</strong></span></a>.
      </p><p>
        To start and stop MySQL automatically on your server, you must
        add start and stop commands to the appropriate places in your
        <code class="filename">/etc/rc*</code> files:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            If you use the Linux server RPM package
            (<code class="literal">MySQL-server-<em class="replaceable"><code>VERSION</code></em>.rpm</code>),
            or a native Linux package installation, the
            <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> script may be installed in
            the <code class="filename">/etc/init.d</code> directory with the name
            <code class="filename">mysqld</code> or <code class="filename">mysql</code>.
            See <a class="xref" href="installing.html#linux-installation-rpm" title="2.5.4 Installing MySQL on Linux Using RPM Packages from Oracle">Section 2.5.4, “Installing MySQL on Linux Using RPM Packages from Oracle”</a>, for more
            information on the Linux RPM packages.
          </p></li><li class="listitem"><p>
            If you install MySQL from a source distribution or using a
            binary distribution format that does not install
            <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> automatically, you can
            install the script manually. It can be found in the
            <code class="filename">support-files</code> directory under the MySQL
            installation directory or in a MySQL source tree. Copy the
            script to the <code class="filename">/etc/init.d</code> directory
            with the name <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> and make it
            executable:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>cp mysql.server /etc/init.d/mysql</code></strong>
shell&gt; <strong class="userinput"><code>chmod +x /etc/init.d/mysql</code></strong>
</pre><p>
            After installing the script, the commands needed to activate
            it to run at system startup depend on your operating system.
            On Linux, you can use <span class="command"><strong>chkconfig</strong></span>:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>chkconfig --add mysql</code></strong>
</pre><p>
            On some Linux systems, the following command also seems to
            be necessary to fully enable the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
            script:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>chkconfig --level 345 mysql on</code></strong>
</pre></li><li class="listitem"><p>
            On FreeBSD, startup scripts generally should go in
            <code class="filename">/usr/local/etc/rc.d/</code>. Install the
            <code class="filename">mysql.server</code> script as
            <code class="filename">/usr/local/etc/rc.d/mysql.server.sh</code> to
            enable automatic startup. The <code class="literal">rc(8)</code>
            manual page states that scripts in this directory are
            executed only if their base name matches the
            <code class="literal">*.sh</code> shell file name pattern. Any other
            files or directories present within the directory are
            silently ignored.
          </p></li><li class="listitem"><p>
            As an alternative to the preceding setup, some operating
            systems also use <code class="filename">/etc/rc.local</code> or
            <code class="filename">/etc/init.d/boot.local</code> to start
            additional services on startup. To start up MySQL using this
            method, append a command like the one following to the
            appropriate startup file:
          </p><pre data-lang="terminal" class="programlisting">/bin/sh -c 'cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &amp;'</pre></li><li class="listitem"><p>
            For other systems, consult your operating system
            documentation to see how to install startup scripts.
</p></li></ul>
</div>
<p>
        <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> reads options from the
        <code class="literal">[mysql.server]</code> and
        <code class="literal">[mysqld]</code> sections of option files. For
        backward compatibility, it also reads
        <code class="literal">[mysql_server]</code> sections, but to be current
        you should rename such sections to
        <code class="literal">[mysql.server]</code>.
      </p><a class="indexterm" name="idm46444432518304"></a><p>
        You can add options for <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> in a
        global <code class="filename">/etc/my.cnf</code> file. A typical
        <code class="filename">my.cnf</code> file might look like this:
      </p><pre data-lang="ini" class="programlisting">[mysqld]
datadir=/usr/local/mysql/var
socket=/var/tmp/mysql.sock
port=3306
user=mysql

[mysql.server]
basedir=/usr/local/mysql</pre><p>
        The <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> script supports the options
        shown in the following table. If specified, they
        <span class="emphasis"><em>must</em></span> be placed in an option file, not on
        the command line. <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> supports only
        <code class="literal">start</code> and <code class="literal">stop</code> as
        command-line arguments.
</p>
<div class="table">
<a name="idm46444432507712"></a><p class="title"><b>Table 4.7 mysql.server Option-File Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Option-file options available for mysql.server."><col align="left" width="20%"><col align="left" width="70%"><col align="left" width="10%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Type</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysql_server_basedir"><code class="literal">basedir</code></a></td>
<td>Path to MySQL installation directory</td>
<td>Directory name</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_server_datadir"><code class="literal">datadir</code></a></td>
<td>Path to MySQL data directory</td>
<td>Directory name</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_server_pid-file"><code class="literal">pid-file</code></a></td>
<td>File in which server should write its process ID</td>
<td>File name</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_server_service-startup-timeout"><code class="literal">service-startup-timeout</code></a></td>
<td>How long to wait for server startup</td>
<td>Integer</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_server_basedir"></a>
            <a class="indexterm" name="idm46444432480336"></a>

            <a class="indexterm" name="idm46444432478848"></a>

            <a class="link" href="programs.html#option_mysql_server_basedir"><code class="option">basedir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The path to the MySQL installation directory.
          </p></li><li class="listitem"><p><a name="option_mysql_server_datadir"></a>
            <a class="indexterm" name="idm46444432474416"></a>

            <a class="indexterm" name="idm46444432472928"></a>

            <a class="link" href="programs.html#option_mysql_server_datadir"><code class="option">datadir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The path to the MySQL data directory.
          </p></li><li class="listitem"><p><a name="option_mysql_server_pid-file"></a>
            <a class="indexterm" name="idm46444432468496"></a>

            <a class="indexterm" name="idm46444432467008"></a>

            <a class="link" href="programs.html#option_mysql_server_pid-file"><code class="option">pid-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name of the file in which the server should write
            its process ID. The server creates the file in the data
            directory unless an absolute path name is given to specify a
            different directory.
          </p><p>
            If this option is not given, <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a>
            uses a default value of
            <code class="filename"><em class="replaceable"><code>host_name</code></em>.pid</code>.
            The PID file value passed to <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>
            overrides any value specified in the
            <code class="literal">[mysqld_safe]</code> option file group. Because
            <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> reads the
            <code class="literal">[mysqld]</code> option file group but not the
            <code class="literal">[mysqld_safe]</code> group, you can ensure that
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> gets the same value when
            invoked from <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> as when invoked
            manually by putting the same <code class="literal">pid-file</code>
            setting in both the <code class="literal">[mysqld_safe]</code> and
            <code class="literal">[mysqld]</code> groups.
          </p></li><li class="listitem"><p><a name="option_mysql_server_service-startup-timeout"></a>
            <a class="indexterm" name="idm46444432450160"></a>

            <a class="indexterm" name="idm46444432448656"></a>

            <a class="link" href="programs.html#option_mysql_server_service-startup-timeout"><code class="option">service-startup-timeout=<em class="replaceable"><code>seconds</code></em></code></a>
          </p><p>
            How long in seconds to wait for confirmation of server
            startup. If the server does not start within this time,
            <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> exits with an error. The
            default value is 900. A value of 0 means not to wait at all
            for startup. Negative values mean to wait forever (no
            timeout).
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqld-multi"></a>4.3.4 <span class="command"><strong>mysqld_multi</strong></span> — Manage Multiple MySQL Servers</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444432441872"></a><a class="indexterm" name="idm46444432440928"></a><a class="indexterm" name="idm46444432439568"></a><a class="indexterm" name="idm46444432438624"></a><p>
        <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> is designed to manage several
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> processes that listen for connections
        on different Unix socket files and TCP/IP ports. It can start or
        stop servers, or report their current status.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          For some Linux platforms, MySQL installation from RPM or
          Debian packages includes systemd support for managing MySQL
          server startup and shutdown. On these platforms,
          <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> is not installed because it is
          unnecessary. For information about using systemd to handle
          multiple MySQL instances, see <a class="xref" href="installing.html#using-systemd" title="2.5.9 Managing MySQL Server with systemd">Section 2.5.9, “Managing MySQL Server with systemd”</a>.
</p>
</div>
<p>
        <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> searches for groups named
        <code class="literal">[mysqld<em class="replaceable"><code>N</code></em>]</code> in
        <code class="filename">my.cnf</code> (or in the file named by the
        <a class="link" href="programs.html#option_mysqld_multi_defaults-file"><code class="option">--defaults-file</code></a> option).
        <em class="replaceable"><code>N</code></em> can be any positive integer. This
        number is referred to in the following discussion as the option
        group number, or <em class="replaceable"><code>GNR</code></em>. Group numbers
        distinguish option groups from one another and are used as
        arguments to <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> to specify which
        servers you want to start, stop, or obtain a status report for.
        Options listed in these groups are the same that you would use
        in the <code class="literal">[mysqld]</code> group used for starting
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. (See, for example,
        <a class="xref" href="installing.html#automatic-start" title="2.10.5 Starting and Stopping MySQL Automatically">Section 2.10.5, “Starting and Stopping MySQL Automatically”</a>.) However, when using multiple
        servers, it is necessary that each one use its own value for
        options such as the Unix socket file and TCP/IP port number. For
        more information on which options must be unique per server in a
        multiple-server environment, see
        <a class="xref" href="server-administration.html#multiple-servers" title="5.8 Running Multiple MySQL Instances on One Machine">Section 5.8, “Running Multiple MySQL Instances on One Machine”</a>.
      </p><p>
        To invoke <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a>, use the following
        syntax:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_multi [<em class="replaceable"><code>options</code></em>] {start|stop|reload|report} [<em class="replaceable"><code>GNR</code></em>[,<em class="replaceable"><code>GNR</code></em>] ...]</code></strong>
</pre><p>
        <code class="literal">start</code>, <code class="literal">stop</code>,
        <code class="literal">reload</code> (stop and restart), and
        <code class="literal">report</code> indicate which operation to perform.
        You can perform the designated operation for a single server or
        multiple servers, depending on the
        <em class="replaceable"><code>GNR</code></em> list that follows the option
        name. If there is no list, <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a>
        performs the operation for all servers in the option file.
      </p><p>
        Each <em class="replaceable"><code>GNR</code></em> value represents an option
        group number or range of group numbers. The value should be the
        number at the end of the group name in the option file. For
        example, the <em class="replaceable"><code>GNR</code></em> for a group named
        <code class="literal">[mysqld17]</code> is <code class="literal">17</code>. To
        specify a range of numbers, separate the first and last numbers
        by a dash. The <em class="replaceable"><code>GNR</code></em> value
        <code class="literal">10-13</code> represents groups
        <code class="literal">[mysqld10]</code> through
        <code class="literal">[mysqld13]</code>. Multiple groups or group ranges
        can be specified on the command line, separated by commas. There
        must be no whitespace characters (spaces or tabs) in the
        <em class="replaceable"><code>GNR</code></em> list; anything after a whitespace
        character is ignored.
      </p><p>
        This command starts a single server using option group
        <code class="literal">[mysqld17]</code>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_multi start 17</code></strong>
</pre><p>
        This command stops several servers, using option groups
        <code class="literal">[mysqld8]</code> and <code class="literal">[mysqld10]</code>
        through <code class="literal">[mysqld13]</code>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_multi stop 8,10-13</code></strong>
</pre><p>
        For an example of how you might set up an option file, use this
        command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqld_multi --example</code></strong>
</pre><p>
        <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> searches for option files as
        follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqld_multi_no-defaults"></a>
            <a class="indexterm" name="idm46444432392624"></a>

            <a class="indexterm" name="idm46444432391136"></a>

            With <a class="link" href="programs.html#option_mysqld_multi_no-defaults"><code class="option">--no-defaults</code></a>, no
            option files are read.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_defaults-file"></a>
            <a class="indexterm" name="idm46444432387296"></a>

            <a class="indexterm" name="idm46444432385808"></a>

            With
            <a class="link" href="programs.html#option_mysqld_multi_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            only the named file is read.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444432381680"></a>

            <a class="indexterm" name="idm46444432380224"></a>

            Otherwise, option files in the standard list of locations
            are read, including any file named by the
            <a class="link" href="programs.html#option_mysqld_multi_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
            option, if one is given. (If the option is given multiple
            times, the last value is used.)
</p></li></ul>
</div>
<p>
        For additional information about these and other option-file
        options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
      </p><p>
        Option files read are searched for
        <code class="literal">[mysqld_multi]</code> and
        <code class="literal">[mysqld<em class="replaceable"><code>N</code></em>]</code> option
        groups. The <code class="literal">[mysqld_multi]</code> group can be used
        for options to <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> itself.
        <code class="literal">[mysqld<em class="replaceable"><code>N</code></em>]</code> groups
        can be used for options passed to specific
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> instances.
      </p><p>
        The <code class="literal">[mysqld]</code> or
        <code class="literal">[mysqld_safe]</code> groups can be used for common
        options read by all instances of <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> or
        <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a>. You can specify a
        <a class="link" href="server-administration.html#option_mysqld_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
        option to use a different configuration file for that instance,
        in which case the <code class="literal">[mysqld]</code> or
        <code class="literal">[mysqld_safe]</code> groups from that file will be
        used for that instance.
      </p><p>
        <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> supports the following options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqld_multi_help"></a>
            <a class="indexterm" name="idm46444432358624"></a>

            <a class="indexterm" name="idm46444432357136"></a>

            <a class="link" href="programs.html#option_mysqld_multi_help"><code class="option">--help</code></a>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_example"></a>
            <a class="indexterm" name="idm46444432352816"></a>

            <a class="indexterm" name="idm46444432351328"></a>

            <a class="link" href="programs.html#option_mysqld_multi_example"><code class="option">--example</code></a>
          </p><p>
            Display a sample option file.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_log"></a>
            <a class="indexterm" name="idm46444432347200"></a>

            <a class="indexterm" name="idm46444432345744"></a>

            <a class="link" href="programs.html#option_mysqld_multi_log"><code class="option">--log=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Specify the name of the log file. If the file exists, log
            output is appended to it.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_mysqladmin"></a>
            <a class="indexterm" name="idm46444432341120"></a>

            <a class="indexterm" name="idm46444432339632"></a>

            <a class="link" href="programs.html#option_mysqld_multi_mysqladmin"><code class="option">--mysqladmin=<em class="replaceable"><code>prog_name</code></em></code></a>
          </p><p>
            The <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> binary to be used to stop
            servers.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_mysqld"></a>
            <a class="indexterm" name="idm46444432333856"></a>

            <a class="indexterm" name="idm46444432332368"></a>

            <a class="link" href="programs.html#option_mysqld_multi_mysqld"><code class="option">--mysqld=<em class="replaceable"><code>prog_name</code></em></code></a>
          </p><p>
            The <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> binary to be used. Note that
            you can specify <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> as the value
            for this option also. If you use
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> to start the server, you can
            include the <code class="literal">mysqld</code> or
            <code class="literal">ledir</code> options in the corresponding
            <code class="literal">[mysqld<em class="replaceable"><code>N</code></em>]</code>
            option group. These options indicate the name of the server
            that <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> should start and the
            path name of the directory where the server is located. (See
            the descriptions for these options in
            <a class="xref" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script">Section 4.3.2, “<span class="command"><strong>mysqld_safe</strong></span> — MySQL Server Startup Script”</a>.) Example:
          </p><pre data-lang="ini" class="programlisting">[mysqld38]
mysqld = mysqld-debug
ledir  = /opt/local/mysql/libexec</pre></li><li class="listitem"><p><a name="option_mysqld_multi_no-log"></a>
            <a class="indexterm" name="idm46444432318416"></a>

            <a class="indexterm" name="idm46444432316928"></a>

            <a class="link" href="programs.html#option_mysqld_multi_no-log"><code class="option">--no-log</code></a>
          </p><p>
            Print log information to <code class="literal">stdout</code> rather
            than to the log file. By default, output goes to the log
            file.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_password"></a>
            <a class="indexterm" name="idm46444432311824"></a>

            <a class="indexterm" name="idm46444432310336"></a>

            <a class="link" href="programs.html#option_mysqld_multi_password"><code class="option">--password=<em class="replaceable"><code>password</code></em></code></a>
          </p><p>
            The password of the MySQL account to use when invoking
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>. Note that the password value
            is not optional for this option, unlike for other MySQL
            programs.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_silent"></a>
            <a class="indexterm" name="idm46444432304368"></a>

            <a class="indexterm" name="idm46444432302880"></a>

            <a class="link" href="programs.html#option_mysqld_multi_silent"><code class="option">--silent</code></a>
          </p><p>
            Silent mode; disable warnings.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_tcp-ip"></a>
            <a class="indexterm" name="idm46444432298640"></a>

            <a class="indexterm" name="idm46444432297152"></a>

            <a class="link" href="programs.html#option_mysqld_multi_tcp-ip"><code class="option">--tcp-ip</code></a>
          </p><p>
            Connect to each MySQL server through the TCP/IP port instead
            of the Unix socket file. (If a socket file is missing, the
            server might still be running, but accessible only through
            the TCP/IP port.) By default, connections are made using the
            Unix socket file. This option affects
            <code class="literal">stop</code> and <code class="literal">report</code>
            operations.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_user"></a>
            <a class="indexterm" name="idm46444432291136"></a>

            <a class="indexterm" name="idm46444432289648"></a>

            <a class="link" href="programs.html#option_mysqld_multi_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>
          </p><p>
            The user name of the MySQL account to use when invoking
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_verbose"></a>
            <a class="indexterm" name="idm46444432283792"></a>

            <a class="indexterm" name="idm46444432282304"></a>

            <a class="link" href="programs.html#option_mysqld_multi_verbose"><code class="option">--verbose</code></a>
          </p><p>
            Be more verbose.
          </p></li><li class="listitem"><p><a name="option_mysqld_multi_version"></a>
            <a class="indexterm" name="idm46444432278112"></a>

            <a class="indexterm" name="idm46444432276624"></a>

            <a class="link" href="programs.html#option_mysqld_multi_version"><code class="option">--version</code></a>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>
<p>
        Some notes about <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="bold"><strong>Most important</strong></span>: Before
            using <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> be sure that you
            understand the meanings of the options that are passed to
            the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> servers and
            <span class="emphasis"><em>why</em></span> you would want to have separate
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> processes. Beware of the dangers
            of using multiple <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> servers with the
            same data directory. Use separate data directories, unless
            you <span class="emphasis"><em>know</em></span> what you are doing. Starting
            multiple servers with the same data directory does
            <span class="emphasis"><em>not</em></span> give you extra performance in a
            threaded system. See <a class="xref" href="server-administration.html#multiple-servers" title="5.8 Running Multiple MySQL Instances on One Machine">Section 5.8, “Running Multiple MySQL Instances on One Machine”</a>.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
              Make sure that the data directory for each server is fully
              accessible to the Unix account that the specific
              <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> process is started as.
              <span class="emphasis"><em>Do not</em></span> use the Unix
              <em class="replaceable"><code>root</code></em> account for this, unless
              you <span class="emphasis"><em>know</em></span> what you are doing. See
              <a class="xref" href="security.html#changing-mysql-user" title="6.1.5 How to Run MySQL as a Normal User">Section 6.1.5, “How to Run MySQL as a Normal User”</a>.
</p>
</div>
</li><li class="listitem"><p>
            Make sure that the MySQL account used for stopping the
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> servers (with the
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> program) has the same user
            name and password for each server. Also, make sure that the
            account has the <a class="link" href="security.html#priv_shutdown"><code class="literal">SHUTDOWN</code></a>
            privilege. If the servers that you want to manage have
            different user names or passwords for the administrative
            accounts, you might want to create an account on each server
            that has the same user name and password. For example, you
            might set up a common <code class="literal">multi_admin</code> account
            by executing the following commands for each server:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql -u root -S /tmp/mysql.sock -p</code></strong>
Enter password:
mysql&gt; <strong class="userinput"><code>CREATE USER 'multi_admin'@'localhost' IDENTIFIED BY 'multipass';</code></strong>
mysql&gt; <strong class="userinput"><code>GRANT SHUTDOWN ON *.* TO 'multi_admin'@'localhost';</code></strong>
</pre><p>
            See <a class="xref" href="security.html#access-control" title="6.2 Access Control and Account Management">Section 6.2, “Access Control and Account Management”</a>. You have to do this
            for each <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server. Change the
            connection parameters appropriately when connecting to each
            one. Note that the host name part of the account name must
            permit you to connect as <code class="literal">multi_admin</code> from
            the host where you want to run
            <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a>.
          </p></li><li class="listitem"><p>
            The Unix socket file and the TCP/IP port number must be
            different for every <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>.
            (Alternatively, if the host has multiple network addresses,
            you can set the
            <a class="link" href="server-administration.html#sysvar_bind_address"><code class="literal">bind_address</code></a> system
            variable to cause different servers to listen to different
            interfaces.)
          </p></li><li class="listitem"><p>
            The <a class="link" href="programs.html#option_mysqld_safe_pid-file"><code class="option">--pid-file</code></a> option is
            very important if you are using
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> to start
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> (for example,
            <a class="link" href="programs.html#option_mysqld_safe_mysqld"><code class="option">--mysqld=mysqld_safe</code></a>)
            Every <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> should have its own process
            ID file. The advantage of using
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> instead of
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is that
            <a class="link" href="programs.html#mysqld-safe" title="4.3.2 mysqld_safe — MySQL Server Startup Script"><span class="command"><strong>mysqld_safe</strong></span></a> monitors its
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> process and restarts it if the
            process terminates due to a signal sent using <code class="literal">kill
            -9</code> or for other reasons, such as a segmentation
            fault.
          </p></li><li class="listitem"><p>
            You might want to use the
            <a class="link" href="server-administration.html#option_mysqld_user"><code class="option">--user</code></a> option for
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, but to do this you need to run
            the <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a> script as the Unix
            superuser (<code class="literal">root</code>). Having the option in
            the option file doesn't matter; you just get a warning if
            you are not the superuser and the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
            processes are started under your own Unix account.
</p></li></ul>
</div>
<p>
        The following example shows how you might set up an option file
        for use with <a class="link" href="programs.html#mysqld-multi" title="4.3.4 mysqld_multi — Manage Multiple MySQL Servers"><span class="command"><strong>mysqld_multi</strong></span></a>. The order in which
        the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> programs are started or stopped
        depends on the order in which they appear in the option file.
        Group numbers need not form an unbroken sequence. The first and
        fifth <code class="literal">[mysqld<em class="replaceable"><code>N</code></em>]</code>
        groups were intentionally omitted from the example to illustrate
        that you can have <span class="quote">“<span class="quote">gaps</span>”</span> in the option file. This
        gives you more flexibility.
      </p><pre data-lang="ini" class="programlisting"># This is an example of a my.cnf file for mysqld_multi.
# Usually this file is located in home dir ~/.my.cnf or /etc/my.cnf

[mysqld_multi]
mysqld     = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
user       = multi_admin
password   = my_password

[mysqld2]
socket     = /tmp/mysql.sock2
port       = 3307
pid-file   = /usr/local/mysql/data2/hostname.pid2
datadir    = /usr/local/mysql/data2
language   = /usr/local/mysql/share/mysql/english
user       = unix_user1

[mysqld3]
mysqld     = /path/to/mysqld_safe
ledir      = /path/to/mysqld-binary/
mysqladmin = /path/to/mysqladmin
socket     = /tmp/mysql.sock3
port       = 3308
pid-file   = /usr/local/mysql/data3/hostname.pid3
datadir    = /usr/local/mysql/data3
language   = /usr/local/mysql/share/mysql/swedish
user       = unix_user2

[mysqld4]
socket     = /tmp/mysql.sock4
port       = 3309
pid-file   = /usr/local/mysql/data4/hostname.pid4
datadir    = /usr/local/mysql/data4
language   = /usr/local/mysql/share/mysql/estonia
user       = unix_user3

[mysqld6]
socket     = /tmp/mysql.sock6
port       = 3311
pid-file   = /usr/local/mysql/data6/hostname.pid6
datadir    = /usr/local/mysql/data6
language   = /usr/local/mysql/share/mysql/japanese
user       = unix_user4</pre><p>
        See <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-installation"></a>4.4 Installation-Related Programs</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#comp-err">4.4.1 <span class="command"><strong>comp_err</strong></span> — Compile MySQL Error Message File</a></span></dt><dt><span class="section"><a href="programs.html#mysql-secure-installation">4.4.2 <span class="command"><strong>mysql_secure_installation</strong></span> — Improve MySQL Installation Security</a></span></dt><dt><span class="section"><a href="programs.html#mysql-ssl-rsa-setup">4.4.3 <span class="command"><strong>mysql_ssl_rsa_setup</strong></span> — Create SSL/RSA Files</a></span></dt><dt><span class="section"><a href="programs.html#mysql-tzinfo-to-sql">4.4.4 <span class="command"><strong>mysql_tzinfo_to_sql</strong></span> — Load the Time Zone Tables</a></span></dt><dt><span class="section"><a href="programs.html#mysql-upgrade">4.4.5 <span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables</a></span></dt></dl>
</div>
<p>
    The programs in this section are used when installing or upgrading
    MySQL.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="comp-err"></a>4.4.1 <span class="command"><strong>comp_err</strong></span> — Compile MySQL Error Message File</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46444432210208"></a><p>
        <a class="link" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File"><span class="command"><strong>comp_err</strong></span></a> creates the
        <code class="filename">errmsg.sys</code> file that is used by
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to determine the error messages to
        display for different error codes. <a class="link" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File"><span class="command"><strong>comp_err</strong></span></a>
        normally is run automatically when MySQL is built. It compiles
        the <code class="filename">errmsg.sys</code> file from text-format error
        information in MySQL source distributions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            As of MySQL 8.0.19, the error information comes from the
            <code class="filename">messages_to_error_log.txt</code> and
            <code class="filename">messages_to_clients.txt</code> files in the
            <code class="filename">share</code> directory.
          </p><p>
            For more information about defining error messages, see the
            comments within those files, along with the
            <code class="filename">errmsg_readme.txt</code> file.
          </p></li><li class="listitem"><p>
            Prior to MySQL 8.0.19, the error information comes from the
            <code class="filename">errmsg-utf8.txt</code> file in the
            <code class="filename">sql/share</code> directory.
</p></li></ul>
</div>
<p>
        <a class="link" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File"><span class="command"><strong>comp_err</strong></span></a> also generates the
        <code class="filename">mysqld_error.h</code>,
        <code class="filename">mysqld_ername.h</code>, and
        <code class="filename">mysqld_errmsg.h</code> header files.
      </p><p>
        Invoke <a class="link" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File"><span class="command"><strong>comp_err</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>comp_err [<em class="replaceable"><code>options</code></em>]</code></strong>
</pre><p>
        <a class="link" href="programs.html#comp-err" title="4.4.1 comp_err — Compile MySQL Error Message File"><span class="command"><strong>comp_err</strong></span></a> supports the following options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_comp_err_help"></a>
            <a class="indexterm" name="idm46444432185968"></a>

            <a class="indexterm" name="idm46444432184512"></a>

            <a class="link" href="programs.html#option_comp_err_help"><code class="option">--help</code></a>, <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_comp_err_charset"></a>
            <a class="indexterm" name="idm46444432179904"></a>

            <a class="indexterm" name="idm46444432178448"></a>

            <a class="link" href="programs.html#option_comp_err_charset"><code class="option">--charset=<em class="replaceable"><code>dir_name</code></em></code></a>,
            <code class="option">-C <em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            The character set directory. The default is
            <code class="filename">../sql/share/charsets</code>.
          </p></li><li class="listitem"><p><a name="option_comp_err_debug"></a>
            <a class="indexterm" name="idm46444432172400"></a>

            <a class="indexterm" name="idm46444432170944"></a>

            <a class="link" href="programs.html#option_comp_err_debug"><code class="option">--debug=<em class="replaceable"><code>debug_options</code></em></code></a>,
            <code class="option">-# <em class="replaceable"><code>debug_options</code></em></code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:O,<em class="replaceable"><code>file_name</code></em></code>.
            The default is <code class="literal">d:t:O,/tmp/comp_err.trace</code>.
          </p></li><li class="listitem"><p><a name="option_comp_err_debug-info"></a>
            <a class="indexterm" name="idm46444432163424"></a>

            <a class="indexterm" name="idm46444432161936"></a>

            <a class="link" href="programs.html#option_comp_err_debug-info"><code class="option">--debug-info</code></a>,
            <code class="option">-T</code>
          </p><p>
            Print some debugging information when the program exits.
          </p></li><li class="listitem"><p><a name="option_comp_err_errmsg-file"></a>
            <a class="indexterm" name="idm46444432157200"></a>

            <a class="indexterm" name="idm46444432155712"></a>

            <a class="link" href="programs.html#option_comp_err_errmsg-file"><code class="option">--errmsg-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-H <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the error message file. The default is
            <code class="filename">mysqld_errmsg.h</code>. This option was added
            in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_comp_err_header-file"></a>
            <a class="indexterm" name="idm46444432149664"></a>

            <a class="indexterm" name="idm46444432148176"></a>

            <a class="link" href="programs.html#option_comp_err_header-file"><code class="option">--header-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-H <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the error header file. The default is
            <code class="filename">mysqld_error.h</code>.
          </p></li><li class="listitem"><p><a name="option_comp_err_in-file"></a>
            <a class="indexterm" name="idm46444432142176"></a>

            <a class="indexterm" name="idm46444432140720"></a>

            <a class="link" href="programs.html#option_comp_err_in-file"><code class="option">--in-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-F <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the input file. The default is
            <code class="filename">../share/errmsg-utf8.txt</code>.
          </p><p>
            This option was removed in MySQL 8.0.19 and replaced by the
            <a class="link" href="programs.html#option_comp_err_in-file-errlog"><code class="option">--in-file-errlog</code></a> and
            <a class="link" href="programs.html#option_comp_err_in-file-toclient"><code class="option">--in-file-toclient</code></a> options.
          </p></li><li class="listitem"><p><a name="option_comp_err_in-file-errlog"></a>
            <a class="indexterm" name="idm46444432132032"></a>

            <a class="indexterm" name="idm46444432130544"></a>

            <a class="link" href="programs.html#option_comp_err_in-file-errlog"><code class="option">--in-file-errlog=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-e <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the input file that defines error messages
            intended to be written to the error log. The default is
            <code class="filename">../share/messages_to_error_log.txt</code>.
          </p><p>
            This option was added in MySQL 8.0.19.
          </p></li><li class="listitem"><p><a name="option_comp_err_in-file-toclient"></a>
            <a class="indexterm" name="idm46444432124080"></a>

            <a class="indexterm" name="idm46444432122592"></a>

            <a class="link" href="programs.html#option_comp_err_in-file-toclient"><code class="option">--in-file-toclient=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-c <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the input file that defines error messages
            intended to be written to clients. The default is
            <code class="filename">../share/messages_to_clients.txt</code>.
          </p><p>
            This option was added in MySQL 8.0.19.
          </p></li><li class="listitem"><p><a name="option_comp_err_name-file"></a>
            <a class="indexterm" name="idm46444432116144"></a>

            <a class="indexterm" name="idm46444432114656"></a>

            <a class="link" href="programs.html#option_comp_err_name-file"><code class="option">--name-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-N <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the error name file. The default is
            <code class="filename">mysqld_ername.h</code>.
          </p></li><li class="listitem"><p><a name="option_comp_err_out-dir"></a>
            <a class="indexterm" name="idm46444432108656"></a>

            <a class="indexterm" name="idm46444432107200"></a>

            <a class="link" href="programs.html#option_comp_err_out-dir"><code class="option">--out-dir=<em class="replaceable"><code>dir_name</code></em></code></a>,
            <code class="option">-D <em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            The name of the output base directory. The default is
            <code class="filename">../sql/share/</code>.
          </p></li><li class="listitem"><p><a name="option_comp_err_out-file"></a>
            <a class="indexterm" name="idm46444432101152"></a>

            <a class="indexterm" name="idm46444432099664"></a>

            <a class="link" href="programs.html#option_comp_err_out-file"><code class="option">--out-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-O <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            The name of the output file. The default is
            <code class="filename">errmsg.sys</code>.
          </p></li><li class="listitem"><p><a name="option_comp_err_version"></a>
            <a class="indexterm" name="idm46444432093680"></a>

            <a class="indexterm" name="idm46444432092224"></a>

            <a class="link" href="programs.html#option_comp_err_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-secure-installation"></a>4.4.2 <span class="command"><strong>mysql_secure_installation</strong></span> — Improve MySQL Installation Security</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444432086816"></a><p>
        This program enables you to improve the security of your MySQL
        installation in the following ways:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            You can set a password for <code class="literal">root</code> accounts.
          </p></li><li class="listitem"><p>
            You can remove <code class="literal">root</code> accounts that are
            accessible from outside the local host.
          </p></li><li class="listitem"><p>
            You can remove anonymous-user accounts.
          </p></li><li class="listitem"><p>
            You can remove the <code class="literal">test</code> database (which
            by default can be accessed by all users, even anonymous
            users), and privileges that permit anyone to access
            databases with names that start with
            <code class="literal">test_</code>.
</p></li></ul>
</div>
<p>
        <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> helps you implement
        security recommendations similar to those described at
        <a class="xref" href="installing.html#default-privileges" title="2.10.4 Securing the Initial MySQL Account">Section 2.10.4, “Securing the Initial MySQL Account”</a>.
      </p><p>
        Normal usage is to connect to the local MySQL server; invoke
        <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> without arguments:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_secure_installation</code></strong>
</pre><p>
        When executed, <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a>
        prompts you to determine which actions to perform.
      </p><p>
        The <code class="literal">validate_password</code> component can be used
        for password strength checking. If the plugin is not installed,
        <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> prompts the user
        whether to install it. Any passwords entered later are checked
        using the plugin if it is enabled.
      </p><p>
        Most of the usual MySQL client options such as
        <a class="link" href="programs.html#option_mysql_secure_installation_host"><code class="option">--host</code></a> and
        <a class="link" href="programs.html#option_mysql_secure_installation_port"><code class="option">--port</code></a> can be
        used on the command line and in option files. For example, to
        connect to the local server over IPv6 using port 3307, use this
        command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_secure_installation --host=::1 --port=3307</code></strong>
</pre><p>
        <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> supports the
        following options, which can be specified on the command line or
        in the <code class="literal">[mysql_secure_installation]</code> and
        <code class="literal">[client]</code> groups of an option file. For
        information about option files used by MySQL programs, see
        <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444432059648"></a><p class="title"><b>Table 4.8 mysql_secure_installation Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysql_secure_installation."><col width="31%"><col width="56%"><col width="12%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_general_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_password">--password</a></td>
<td>Accepted but always ignored. Whenever mysql_secure_installation is invoked, the user is prompted for a password, regardless</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_general_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_use-default">--use-default</a></td>
<td>Execute with no user interactivity</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_secure_installation_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_secure_installation_help"></a>
            <a class="indexterm" name="idm46444431965488"></a>

            <a class="indexterm" name="idm46444431964032"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444431959312"></a>

            <a class="indexterm" name="idm46444431957792"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_defaults-file"></a>
            <a class="indexterm" name="idm46444431951248"></a>

            <a class="indexterm" name="idm46444431949744"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444431943344"></a>

            <a class="indexterm" name="idm46444431941824"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> normally reads
            the <code class="literal">[client]</code> and
            <code class="literal">[mysql_secure_installation]</code> groups. If
            the
            <a class="link" href="programs.html#option_mysql_secure_installation_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given,
            <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysql_secure_installation_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_host"></a>
            <a class="indexterm" name="idm46444431928960"></a>

            <a class="indexterm" name="idm46444431927504"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_no-defaults"></a>
            <a class="indexterm" name="idm46444431922208"></a>

            <a class="indexterm" name="idm46444431920752"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysql_secure_installation_no-defaults"><code class="option">--no-defaults</code></a>
            can be used to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysql_secure_installation_no-defaults"><code class="option">--no-defaults</code></a>
            is used. (<code class="filename">.mylogin.cnf</code> is created by
            the <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_password"></a>
            <a class="indexterm" name="idm46444431909152"></a>

            <a class="indexterm" name="idm46444431907648"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_password"><code class="option">--password=<em class="replaceable"><code>password</code></em></code></a>,
            <code class="option">-p <em class="replaceable"><code>password</code></em></code>
          </p><p>
            This option is accepted but ignored. Whether or not this
            option is used, <a class="link" href="programs.html#mysql-secure-installation" title="4.4.2 mysql_secure_installation — Improve MySQL Installation Security"><span class="command"><strong>mysql_secure_installation</strong></span></a>
            always prompts the user for a password.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_port"></a>
            <a class="indexterm" name="idm46444431901120"></a>

            <a class="indexterm" name="idm46444431899664"></a>

            <a class="indexterm" name="idm46444431898160"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_print-defaults"></a>
            <a class="indexterm" name="idm46444431893296"></a>

            <a class="indexterm" name="idm46444431891840"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_protocol"></a>
            <a class="indexterm" name="idm46444431886336"></a>

            <a class="indexterm" name="idm46444431884832"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_socket"></a>
            <a class="indexterm" name="idm46444431879744"></a>

            <a class="indexterm" name="idm46444431878288"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the the connection must be a member of the
            Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_ssl"></a>
            <a class="indexterm" name="idm46444431869088"></a>

            <a class="indexterm" name="idm46444431867632"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysql_secure_installation_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444431861536"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysql_secure_installation_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            option differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These
            <a class="link" href="programs.html#option_mysql_secure_installation_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysql_secure_installation_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
              is <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysql_secure_installation_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
              to <code class="literal">ON</code> or <code class="literal">STRICT</code>
              causes the client to produce a warning at startup and to
              operate in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysql_secure_installation_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444431844288"></a>

            <a class="indexterm" name="idm46444431842784"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_tls-version"></a>
            <a class="indexterm" name="idm46444431836784"></a>

            <a class="indexterm" name="idm46444431835328"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_use-default"></a>
            <a class="indexterm" name="idm46444431829824"></a>

            <a class="indexterm" name="idm46444431828368"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_use-default"><code class="option">--use-default</code></a>
          </p><p>
            Execute noninteractively. This option can be used for
            unattended installation operations.
          </p></li><li class="listitem"><p><a name="option_mysql_secure_installation_user"></a>
            <a class="indexterm" name="idm46444431824128"></a>

            <a class="indexterm" name="idm46444431822672"></a>

            <a class="link" href="programs.html#option_mysql_secure_installation_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-ssl-rsa-setup"></a>4.4.3 <span class="command"><strong>mysql_ssl_rsa_setup</strong></span> — Create SSL/RSA Files</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444431816576"></a><p>
        This program creates the SSL certificate and key files and RSA
        key-pair files required to support secure connections using SSL
        and secure password exchange using RSA over unencrypted
        connections, if those files are missing.
        <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> can also be used to
        create new SSL files if the existing ones have expired.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> uses the
          <span class="command"><strong>openssl</strong></span> command, so its use is contingent
          on having OpenSSL installed on your machine.
        </p><p>
          Another way to generate SSL and RSA files, for MySQL
          distributions compiled using OpenSSL, is to have the server
          generate them automatically. See
          <a class="xref" href="security.html#creating-ssl-rsa-files-using-mysql" title="6.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL">Section 6.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”</a>.
</p>
</div>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Important
</div>
<p>
          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> helps lower the barrier
          to using SSL by making it easier to generate the required
          files. However, certificates generated by
          <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> are self-signed, which
          is not very secure. After you gain experience using the files
          created by <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a>, consider
          obtaining a CA certificate from a registered certificate
          authority.
</p>
</div>
<p>
        Invoke <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_ssl_rsa_setup [<em class="replaceable"><code>options</code></em>]</code></strong>
</pre><p>
        Typical options are
        <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_datadir"><code class="option">--datadir</code></a> to specify
        where to create the files, and
        <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_verbose"><code class="option">--verbose</code></a> to see the
        <span class="command"><strong>openssl</strong></span> commands that
        <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> executes.
      </p><p>
        <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> attempts to create SSL
        and RSA files using a default set of file names. It works as
        follows:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> checks for the
            <span class="command"><strong>openssl</strong></span> binary at the locations specified
            by the <code class="literal">PATH</code> environment variable. If
            <span class="command"><strong>openssl</strong></span> is not found,
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> does nothing. If
            <span class="command"><strong>openssl</strong></span> is present,
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> looks for default SSL
            and RSA files in the MySQL data directory specified by the
            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_datadir"><code class="option">--datadir</code></a>
            option, or the compiled-in data directory if the
            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_datadir"><code class="option">--datadir</code></a> option
            is not given.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> checks the data
            directory for SSL files with the following names:
          </p><pre data-lang="none" class="programlisting">ca.pem
server-cert.pem
server-key.pem</pre></li><li class="listitem"><p>
            If any of those files are present,
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> creates no SSL files.
            Otherwise, it invokes <span class="command"><strong>openssl</strong></span> to create
            them, plus some additional files:
          </p><pre data-lang="none" class="programlisting">ca.pem               Self-signed CA certificate
ca-key.pem           CA private key
server-cert.pem      Server certificate
server-key.pem       Server private key
client-cert.pem      Client certificate
client-key.pem       Client private key</pre><p>
            These files enable secure client connections using SSL; see
            <a class="xref" href="security.html#using-encrypted-connections" title="6.3.1 Configuring MySQL to Use Encrypted Connections">Section 6.3.1, “Configuring MySQL to Use Encrypted Connections”</a>.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> checks the data
            directory for RSA files with the following names:
          </p><pre data-lang="none" class="programlisting">private_key.pem      Private member of private/public key pair
public_key.pem       Public member of private/public key pair</pre></li><li class="listitem"><p>
            If any of these files are present,
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> creates no RSA files.
            Otherwise, it invokes <span class="command"><strong>openssl</strong></span> to create
            them. These files enable secure password exchange using RSA
            over unencrypted connections for accounts authenticated by
            the <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> plugin; see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
</p></li></ol>
</div>
<p>
        For information about the characteristics of files created by
        <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a>, see
        <a class="xref" href="security.html#creating-ssl-rsa-files-using-mysql" title="6.3.3.1 Creating SSL and RSA Certificates and Keys using MySQL">Section 6.3.3.1, “Creating SSL and RSA Certificates and Keys using MySQL”</a>.
      </p><p>
        At startup, the MySQL server automatically uses the SSL files
        created by <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> to enable SSL
        if no explicit SSL options are given other than
        <a class="link" href="server-administration.html#option_mysqld_ssl"><code class="option">--ssl</code></a> (possibly along with
        <a class="link" href="server-administration.html#sysvar_ssl_cipher"><code class="literal">ssl_cipher</code></a>). If you prefer to
        designate the files explicitly, invoke clients with the
        <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a>,
        <a class="link" href="programs.html#option_general_ssl-cert"><code class="option">--ssl-cert</code></a>, and
        <a class="link" href="programs.html#option_general_ssl-key"><code class="option">--ssl-key</code></a> options at startup to
        name the <code class="filename">ca.pem</code>,
        <code class="filename">server-cert.pem</code>, and
        <code class="filename">server-key.pem</code> files, respectively.
      </p><p>
        The server also automatically uses the RSA files created by
        <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> to enable RSA if no
        explicit RSA options are given.
      </p><p>
        If the server is SSL-enabled, clients use SSL by default for the
        connection. To specify certificate and key files explicitly, use
        the <a class="link" href="programs.html#option_general_ssl-ca"><code class="option">--ssl-ca</code></a>,
        <a class="link" href="programs.html#option_general_ssl-cert"><code class="option">--ssl-cert</code></a>, and
        <a class="link" href="programs.html#option_general_ssl-key"><code class="option">--ssl-key</code></a> options to name the
        <code class="filename">ca.pem</code>,
        <code class="filename">client-cert.pem</code>, and
        <code class="filename">client-key.pem</code> files, respectively.
        However, some additional client setup may be required first
        because <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> by default
        creates those files in the data directory. The permissions for
        the data directory normally enable access only to the system
        account that runs the MySQL server, so client programs cannot
        use files located there. To make the files available, copy them
        to a directory that is readable (but <span class="emphasis"><em>not</em></span>
        writable) by clients:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            For local clients, the MySQL installation directory can be
            used. For example, if the data directory is a subdirectory
            of the installation directory and your current location is
            the data directory, you can copy the files like this:
          </p><pre data-lang="terminal" class="programlisting">cp ca.pem client-cert.pem client-key.pem ..</pre></li><li class="listitem"><p>
            For remote clients, distribute the files using a secure
            channel to ensure they are not tampered with during transit.
</p></li></ul>
</div>
<p>
        If the SSL files used for a MySQL installation have expired, you
        can use <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> to create new
        ones:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Stop the server.
          </p></li><li class="listitem"><p>
            Rename or remove the existing SSL files. You may wish to
            make a backup of them first. (The RSA files do not expire,
            so you need not remove them.
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> will see that they
            exist and not overwrite them.)
          </p></li><li class="listitem"><p>
            Run <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> with the
            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_datadir"><code class="option">--datadir</code></a> option
            to specify where to create the new files.
          </p></li><li class="listitem"><p>
            Restart the server.
</p></li></ol>
</div>
<p>
        <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> supports the following
        command-line options, which can be specified on the command line
        or in the <code class="literal">[mysql_ssl_rsa_setup]</code> and
        <code class="literal">[mysqld]</code> groups of an option file. For
        information about option files used by MySQL programs, see
        <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444431728688"></a><p class="title"><b>Table 4.9 mysql_ssl_rsa_setup Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysql_ssl_rsa_setup."><col width="35%"><col width="64%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl_rsa_setup_datadir">--datadir</a></td>
<td>Path to data directory</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl_rsa_setup_help">--help</a></td>
<td>Display help message and exit</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl_rsa_setup_suffix">--suffix</a></td>
<td>Suffix for X.509 certificate Common Name attribute</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl_rsa_setup_uid">--uid</a></td>
<td>Name of effective user to use for file permissions</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl_rsa_setup_verbose">--verbose</a></td>
<td>Verbose mode</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl_rsa_setup_version">--version</a></td>
<td>Display version information and exit</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_ssl_rsa_setup_help"></a>
            <a class="indexterm" name="idm46444431703088"></a>

            <a class="indexterm" name="idm46444431701600"></a>

            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_help"><code class="option">--help</code></a>,
            <code class="option">?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl_rsa_setup_datadir"></a>
            <a class="indexterm" name="idm46444431697040"></a>

            <a class="indexterm" name="idm46444431695552"></a>

            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_datadir"><code class="option">--datadir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The path to the directory that
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> should check for
            default SSL and RSA files and in which it should create
            files if they are missing. The default is the compiled-in
            data directory.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl_rsa_setup_suffix"></a>
            <a class="indexterm" name="idm46444431689712"></a>

            <a class="indexterm" name="idm46444431688224"></a>

            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_suffix"><code class="option">--suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            The suffix for the Common Name attribute in X.509
            certificates. The suffix value is limited to 17 characters.
            The default is based on the MySQL version number.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl_rsa_setup_uid"></a>
            <a class="indexterm" name="idm46444431683680"></a>

            <a class="indexterm" name="idm46444431682192"></a>

            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_uid"><code class="option">--uid=name</code></a>,
            <code class="option">-v</code>
          </p><p>
            The name of the user who should be the owner of any created
            files. The value is a user name, not a numeric user ID. In
            the absence of this option, files created by
            <a class="link" href="programs.html#mysql-ssl-rsa-setup" title="4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files"><span class="command"><strong>mysql_ssl_rsa_setup</strong></span></a> are owned by the user
            who executes it. This option is valid only if you execute
            the program as <code class="literal">root</code> on a system that
            supports the <code class="literal">chown()</code> system call.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl_rsa_setup_verbose"></a>
            <a class="indexterm" name="idm46444431674656"></a>

            <a class="indexterm" name="idm46444431673168"></a>

            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Produce more output about what the program
            does. For example, the program shows the
            <span class="command"><strong>openssl</strong></span> commands it runs, and produces
            output to indicate whether it skips SSL or RSA file creation
            because some default file already exists.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl_rsa_setup_version"></a>
            <a class="indexterm" name="idm46444431667664"></a>

            <a class="indexterm" name="idm46444431666176"></a>

            <a class="link" href="programs.html#option_mysql_ssl_rsa_setup_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-tzinfo-to-sql"></a>4.4.4 <span class="command"><strong>mysql_tzinfo_to_sql</strong></span> — Load the Time Zone Tables</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444431660752"></a><a class="indexterm" name="idm46444431659808"></a><p>
        The <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a> program loads the
        time zone tables in the <code class="literal">mysql</code> database. It is
        used on systems that have a
        <span class="firstterm">zoneinfo</span> database (the set
        of files describing time zones). Examples of such systems are
        Linux, FreeBSD, Solaris, and macOS. One likely location for
        these files is the <code class="filename">/usr/share/zoneinfo</code>
        directory (<code class="filename">/usr/share/lib/zoneinfo</code> on
        Solaris). If your system does not have a zoneinfo database, you
        can use the downloadable package described in
        <a class="xref" href="server-administration.html#time-zone-support" title="5.1.14 MySQL Server Time Zone Support">Section 5.1.14, “MySQL Server Time Zone Support”</a>.
      </p><p>
        <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a> can be invoked several
        ways:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_tzinfo_to_sql <em class="replaceable"><code>tz_dir</code></em></code></strong>
shell&gt; <strong class="userinput"><code>mysql_tzinfo_to_sql <em class="replaceable"><code>tz_file tz_name</code></em></code></strong>
shell&gt; <strong class="userinput"><code>mysql_tzinfo_to_sql --leap <em class="replaceable"><code>tz_file</code></em></code></strong>
</pre><p>
        For the first invocation syntax, pass the zoneinfo directory
        path name to <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a> and send the
        output into the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> program. For example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql</code></strong>
</pre><p>
        <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a> reads your system's time
        zone files and generates SQL statements from them.
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> processes those statements to load the
        time zone tables.
      </p><p>
        The second syntax causes <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a>
        to load a single time zone file
        <em class="replaceable"><code>tz_file</code></em> that corresponds to a time
        zone name <em class="replaceable"><code>tz_name</code></em>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_tzinfo_to_sql <em class="replaceable"><code>tz_file</code></em> <em class="replaceable"><code>tz_name</code></em> | mysql -u root mysql</code></strong>
</pre><p>
        If your time zone needs to account for leap seconds, invoke
        <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a> using the third syntax,
        which initializes the leap second information.
        <em class="replaceable"><code>tz_file</code></em> is the name of your time zone
        file:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_tzinfo_to_sql --leap <em class="replaceable"><code>tz_file</code></em> | mysql -u root mysql</code></strong>
</pre><p>
        After running <a class="link" href="programs.html#mysql-tzinfo-to-sql" title="4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables"><span class="command"><strong>mysql_tzinfo_to_sql</strong></span></a>, it is best
        to restart the server so that it does not continue to use any
        previously cached time zone data.
</p>
</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-upgrade"></a>4.4.5 <span class="command"><strong>mysql_upgrade</strong></span> — Check and Upgrade MySQL Tables</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444431626912"></a><a class="indexterm" name="idm46444431625968"></a><a class="indexterm" name="idm46444431625024"></a>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          As of MySQL 8.0.16, the MySQL server performs the upgrade
          tasks previously handled by <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>
          (for details, see
          <a class="xref" href="installing.html#upgrading-what-is-upgraded" title="2.11.3 What the MySQL Upgrade Process Upgrades">Section 2.11.3, “What the MySQL Upgrade Process Upgrades”</a>). Consequently,
          <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> is unneeded and is deprecated
          as of that version, and will be removed in a future MySQL
          version. Because <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> no longer
          performs upgrade tasks, it exits with status 0
          unconditionally.
</p>
</div>
<p>
        Each time you upgrade MySQL, you should execute
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>, which looks for
        incompatibilities with the upgraded MySQL server:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            It upgrades the system tables in the
            <code class="literal">mysql</code> schema so that you can take
            advantage of new privileges or capabilities that might have
            been added.
          </p></li><li class="listitem"><p>
            It upgrades the Performance Schema,
            <code class="literal">INFORMATION_SCHEMA</code>, and
            <code class="literal">sys</code> schema.
          </p></li><li class="listitem"><p>
            It examines user schemas.
</p></li></ul>
</div>
<p>
        If <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> finds that a table has a
        possible incompatibility, it performs a table check and, if
        problems are found, attempts a table repair. If the table cannot
        be repaired, see <a class="xref" href="installing.html#rebuilding-tables" title="2.11.13 Rebuilding or Repairing Tables or Indexes">Section 2.11.13, “Rebuilding or Repairing Tables or Indexes”</a> for manual
        table repair strategies.
      </p><p>
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> communicates directly with the
        MySQL server, sending it the SQL statements required to perform
        an upgrade.
</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Caution
</div>
<p>
          You should always back up your current MySQL installation
          <span class="emphasis"><em>before</em></span> performing an upgrade. See
          <a class="xref" href="backup-and-recovery.html#backup-methods" title="7.2 Database Backup Methods">Section 7.2, “Database Backup Methods”</a>.
        </p><p>
          Some upgrade incompatibilities may require special handling
          <span class="emphasis"><em>before</em></span> upgrading your MySQL installation
          and running <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>. See
          <a class="xref" href="installing.html#upgrading" title="2.11 Upgrading MySQL">Section 2.11, “Upgrading MySQL”</a>, for instructions on determining
          whether any such incompatibilities apply to your installation
          and how to handle them.
</p>
</div>
<p>
        Use <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> like this:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Ensure that the server is running.
          </p></li><li class="listitem"><p>
            Invoke <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> to upgrade the
            system tables in the <code class="literal">mysql</code> schema and
            check and repair tables in other schemas:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_upgrade [<em class="replaceable"><code>options</code></em>]</code></strong>
</pre></li><li class="listitem"><p>
            Stop the server and restart it so that any system table
            changes take effect.
</p></li></ol>
</div>
<p>
        If you have multiple MySQL server instances to upgrade, invoke
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> with connection parameters
        appropriate for connecting to each of the desired servers. For
        example, with servers running on the local host on parts 3306
        through 3308, upgrade each of them by connecting to the
        appropriate port:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_upgrade --protocol=tcp -P 3306 [<em class="replaceable"><code>other_options</code></em>]</code></strong>
shell&gt; <strong class="userinput"><code>mysql_upgrade --protocol=tcp -P 3307 [<em class="replaceable"><code>other_options</code></em>]</code></strong>
shell&gt; <strong class="userinput"><code>mysql_upgrade --protocol=tcp -P 3308 [<em class="replaceable"><code>other_options</code></em>]</code></strong>
</pre><p>
        For local host connections on Unix, the
        <a class="link" href="programs.html#option_mysql_upgrade_protocol"><code class="option">--protocol=tcp</code></a> option
        forces a connection using TCP/IP rather than the Unix socket
        file.
      </p><p>
        By default, <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> runs as the MySQL
        <code class="literal">root</code> user. If the <code class="literal">root</code>
        password is expired when you run
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>, you will see a message that
        your password is expired and that
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> failed as a result. To correct
        this, reset the <code class="literal">root</code> password to unexpire it
        and run <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> again. First, connect
        to the server as <code class="literal">root</code>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql -u root -p</code></strong>
Enter password: <strong class="userinput"><code>****</code></strong>  &lt;- enter root password here
</pre><p>
        Reset the password using <a class="link" href="sql-statements.html#alter-user" title="13.7.1.1 ALTER USER Statement"><code class="literal">ALTER
        USER</code></a>:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>ALTER USER USER() IDENTIFIED BY '<em class="replaceable"><code>root-password</code></em>';</code></strong>
</pre><p>
        Then exit <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> and run
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> again:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_upgrade [<em class="replaceable"><code>options</code></em>]</code></strong>
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          If you run the server with the
          <a class="link" href="server-administration.html#sysvar_disabled_storage_engines"><code class="literal">disabled_storage_engines</code></a>
          system variable set to disable certain storage engines (for
          example, <code class="literal">MyISAM</code>),
          <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> might fail with an error like
          this:
        </p><pre data-lang="simple" class="programlisting">mysql_upgrade: [ERROR] 3161: Storage engine MyISAM is disabled
(Table creation is disallowed).</pre><p>
          To handle this, restart the server with
          <a class="link" href="server-administration.html#sysvar_disabled_storage_engines"><code class="literal">disabled_storage_engines</code></a>
          disabled. Then you should be able to run
          <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> successfully. After that,
          restart the server with
          <a class="link" href="server-administration.html#sysvar_disabled_storage_engines"><code class="literal">disabled_storage_engines</code></a> set
          to its original value.
</p>
</div>
<p>
        Unless invoked with the
        <a class="link" href="programs.html#option_mysql_upgrade_upgrade-system-tables"><code class="option">--upgrade-system-tables</code></a>
        option, <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> processes all tables in
        all user schemas as necessary. Table checking might take a long
        time to complete. Each table is locked and therefore unavailable
        to other sessions while it is being processed. Check and repair
        operations can be time-consuming, particularly for large tables.
        Table checking uses the <code class="literal">FOR UPGRADE</code> option of
        the <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a> statement. For
        details about what this option entails, see
        <a class="xref" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement">Section 13.7.3.2, “CHECK TABLE Statement”</a>.
      </p><p>
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> marks all checked and repaired
        tables with the current MySQL version number. This ensures that
        the next time you run <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> with the
        same version of the server, it can be determined whether there
        is any need to check or repair a given table again.
      </p><a class="indexterm" name="idm46444431546272"></a><a class="indexterm" name="idm46444431544784"></a><a class="indexterm" name="idm46444431543296"></a><p>
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> saves the MySQL version number
        in a file named <code class="filename">mysql_upgrade_info</code> in the
        data directory. This is used to quickly check whether all tables
        have been checked for this release so that table-checking can be
        skipped. To ignore this file and perform the check regardless,
        use the <a class="link" href="programs.html#option_mysql_upgrade_force"><code class="option">--force</code></a> option.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The <code class="filename">mysql_upgrade_info</code> file is deprecated
          and will be removed in a future MySQL version.
</p>
</div>
<p>
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> checks
        <code class="literal">mysql.user</code> system table rows and, for any row
        with an empty <code class="literal">plugin</code> column, sets that column
        to <code class="literal">'mysql_native_password'</code> if the credentials
        use a hash format compatible with that plugin. Rows with a
        pre-4.1 password hash must be upgraded manually.
      </p><p>
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> does not upgrade the contents
        of the time zone tables or help tables. For upgrade
        instructions, see <a class="xref" href="server-administration.html#time-zone-support" title="5.1.14 MySQL Server Time Zone Support">Section 5.1.14, “MySQL Server Time Zone Support”</a>, and
        <a class="xref" href="server-administration.html#server-side-help-support" title="5.1.16 Server-Side Help Support">Section 5.1.16, “Server-Side Help Support”</a>.
      </p><p>
        Unless invoked with the
        <a class="link" href="programs.html#option_mysql_upgrade_skip-sys-schema"><code class="option">--skip-sys-schema</code></a> option,
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> installs the
        <code class="literal">sys</code> schema if it is not installed, and
        upgrades it to the current version otherwise. An error occurs if
        a <code class="literal">sys</code> schema exists but has no
        <code class="literal">version</code> view, on the assumption that its
        absence indicates a user-created schema:
      </p><pre data-lang="none" class="programlisting">A sys schema exists with no sys.version view. If
you have a user created sys schema, this must be renamed for the
upgrade to succeed.</pre><p>
        To upgrade in this case, remove or rename the existing
        <code class="literal">sys</code> schema first.
      </p><p>
        <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysql_upgrade]</code> and
        <code class="literal">[client]</code> groups of an option file. For
        information about option files used by MySQL programs, see
        <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444431518528"></a><p class="title"><b>Table 4.10 mysql_upgrade Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysql_upgrade."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_character-sets-dir">--character-sets-dir</a></td>
<td>Directory where character sets are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_force">--force</a></td>
<td>Force execution even if mysql_upgrade has already been executed for current MySQL version</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_max-allowed-packet">--max-allowed-packet</a></td>
<td>Maximum packet length to send to or receive from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_net-buffer-length">--net-buffer-length</a></td>
<td>Buffer size for TCP/IP and socket communication</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_skip-sys-schema">--skip-sys-schema</a></td>
<td>Do not install or upgrade sys schema</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_upgrade-system-tables">--upgrade-system-tables</a></td>
<td>Update only system tables, not user schemas</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_version-check">--version-check</a></td>
<td>Check for proper server version</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_write-binlog">--write-binlog</a></td>
<td>Write all statements to binary log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_upgrade_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_upgrade_help"></a>
            <a class="indexterm" name="idm46444431297472"></a>

            <a class="indexterm" name="idm46444431295984"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_help"><code class="option">--help</code></a>
          </p><p>
            Display a short help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_bind-address"></a>
            <a class="indexterm" name="idm46444431291840"></a>

            <a class="indexterm" name="idm46444431290352"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_character-sets-dir"></a>
            <a class="indexterm" name="idm46444431285808"></a>

            <a class="indexterm" name="idm46444431284352"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_compress"></a>
            <a class="indexterm" name="idm46444431279104"></a>

            <a class="indexterm" name="idm46444431277616"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysql_upgrade_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444431269568"></a><a class="indexterm" name="idm46444431268064"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_debug"></a>
            <a class="indexterm" name="idm46444431261248"></a>

            <a class="indexterm" name="idm46444431259760"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:O,/tmp/mysql_upgrade.trace</code>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_debug-check"></a>
            <a class="indexterm" name="idm46444431252112"></a>

            <a class="indexterm" name="idm46444431250624"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_debug-info"></a>
            <a class="indexterm" name="idm46444431246464"></a>

            <a class="indexterm" name="idm46444431244976"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_debug-info"><code class="option">--debug-info</code></a>,
            <code class="option">-T</code>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_default-auth"></a>
            <a class="indexterm" name="idm46444431240352"></a>

            <a class="indexterm" name="idm46444431238864"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_default-character-set"></a>
            <a class="indexterm" name="idm46444431233600"></a>

            <a class="indexterm" name="idm46444431232144"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444431226512"></a>

            <a class="indexterm" name="idm46444431225008"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_defaults-file"></a>
            <a class="indexterm" name="idm46444431218640"></a>

            <a class="indexterm" name="idm46444431217152"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444431210848"></a>

            <a class="indexterm" name="idm46444431209344"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysql_upgrade]</code> groups. If the
            <a class="link" href="programs.html#option_mysql_upgrade_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> also reads
            the <code class="literal">[client_other]</code> and
            <code class="literal">[mysql_upgrade_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_force"></a>
            <a class="indexterm" name="idm46444431196784"></a>

            <a class="indexterm" name="idm46444431195296"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_force"><code class="option">--force</code></a>
          </p><p>
            Ignore the <code class="filename">mysql_upgrade_info</code> file and
            force execution even if <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> has
            already been executed for the current version of MySQL.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_get-server-public-key"></a>
            <a class="indexterm" name="idm46444431189088"></a>

            <a class="indexterm" name="idm46444431187584"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysql_upgrade_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysql_upgrade_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_host"></a>
            <a class="indexterm" name="idm46444431177472"></a>

            <a class="indexterm" name="idm46444431175984"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_login-path"></a>
            <a class="indexterm" name="idm46444431170848"></a>

            <a class="indexterm" name="idm46444431169360"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_max-allowed-packet"></a>
            <a class="indexterm" name="idm46444431160448"></a>

            <a class="indexterm" name="idm46444431158992"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_max-allowed-packet"><code class="option">--max-allowed-packet=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            The maximum size of the buffer for client/server
            communication. The default value is 24MB. The minimum and
            maximum values are 4KB and 2GB.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_net-buffer-length"></a>
            <a class="indexterm" name="idm46444431154368"></a>

            <a class="indexterm" name="idm46444431152912"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_net-buffer-length"><code class="option">--net-buffer-length=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            The initial size of the buffer for client/server
            communication. The default value is 1MB − 1KB. The
            minimum and maximum values are 4KB and 16MB.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_no-defaults"></a>
            <a class="indexterm" name="idm46444431148096"></a>

            <a class="indexterm" name="idm46444431146608"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysql_upgrade_no-defaults"><code class="option">--no-defaults</code></a> can be
            used to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysql_upgrade_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_password"></a>
            <a class="indexterm" name="idm46444431135216"></a>

            <a class="indexterm" name="idm46444431133728"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysql_upgrade_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> should not prompt for one,
            use the
            <a class="link" href="programs.html#option_mysql_upgrade_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_pipe"></a>
            <a class="indexterm" name="idm46444431120960"></a>

            <a class="indexterm" name="idm46444431119472"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_pipe"><code class="option">--pipe</code></a>,
            <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_plugin-dir"></a>
            <a class="indexterm" name="idm46444431112096"></a>

            <a class="indexterm" name="idm46444431110608"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysql_upgrade_default-auth"><code class="option">--default-auth</code></a> option
            is used to specify an authentication plugin but
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_port"></a>
            <a class="indexterm" name="idm46444431103184"></a>

            <a class="indexterm" name="idm46444431101696"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_print-defaults"></a>
            <a class="indexterm" name="idm46444431096560"></a>

            <a class="indexterm" name="idm46444431095072"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_protocol"></a>
            <a class="indexterm" name="idm46444431090880"></a>

            <a class="indexterm" name="idm46444431089392"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_server-public-key-path"></a>
            <a class="indexterm" name="idm46444431084352"></a>

            <a class="indexterm" name="idm46444431082848"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysql_upgrade_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysql_upgrade_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444431068944"></a>

            <a class="indexterm" name="idm46444431067488"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_skip-sys-schema"></a>
            <a class="indexterm" name="idm46444431060368"></a>

            <a class="indexterm" name="idm46444431058880"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_skip-sys-schema"><code class="option">--skip-sys-schema</code></a>
          </p><p>
            By default, <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> installs the
            <code class="literal">sys</code> schema if it is not installed, and
            upgrades it to the current version otherwise. The
            <a class="link" href="programs.html#option_mysql_upgrade_skip-sys-schema"><code class="option">--skip-sys-schema</code></a>
            option suppresses this behavior.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_socket"></a>
            <a class="indexterm" name="idm46444431051696"></a>

            <a class="indexterm" name="idm46444431050208"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_ssl"></a>
            <a class="indexterm" name="idm46444431041056"></a>

            <a class="indexterm" name="idm46444431039568"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysql_upgrade_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444431033664"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysql_upgrade_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysql_upgrade_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysql_upgrade_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysql_upgrade_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysql_upgrade_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444431016544"></a>

            <a class="indexterm" name="idm46444431015056"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_tls-version"></a>
            <a class="indexterm" name="idm46444431009184"></a>

            <a class="indexterm" name="idm46444431007696"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_upgrade-system-tables"></a>
            <a class="indexterm" name="idm46444431001904"></a>

            <a class="indexterm" name="idm46444431000448"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_upgrade-system-tables"><code class="option">--upgrade-system-tables</code></a>,
            <code class="option">-s</code>
          </p><p>
            Upgrade only the system tables in the
            <code class="literal">mysql</code> schema, do not upgrade user
            schemas.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_user"></a>
            <a class="indexterm" name="idm46444430995088"></a>

            <a class="indexterm" name="idm46444430993600"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server. The default user name is
            <code class="literal">root</code>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_verbose"></a>
            <a class="indexterm" name="idm46444430987680"></a>

            <a class="indexterm" name="idm46444430986192"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_verbose"><code class="option">--verbose</code></a>
          </p><p>
            Verbose mode. Print more information about what the program
            does.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_version-check"></a>
            <a class="indexterm" name="idm46444430982016"></a>

            <a class="indexterm" name="idm46444430980528"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_version-check"><code class="option">--version-check</code></a>,
            <code class="option">-k</code>
          </p><p>
            Check the version of the server to which
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> is connecting to verify
            that it is the same as the version for which
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> was built. If not,
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> exits. This option is
            enabled by default; to disable the check, use
            <code class="option">--skip-version-check</code>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_write-binlog"></a>
            <a class="indexterm" name="idm46444430971664"></a>

            <a class="indexterm" name="idm46444430970176"></a>

            <a class="link" href="programs.html#option_mysql_upgrade_write-binlog"><code class="option">--write-binlog</code></a>
          </p><p>
            By default, binary logging by
            <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a> is disabled. Invoke the
            program with
            <a class="link" href="programs.html#option_mysql_upgrade_write-binlog"><code class="option">--write-binlog</code></a> if you
            want its actions to be written to the binary log.
          </p><p>
            When the server is running with global transaction
            identifiers (GTIDs) enabled
            (<a class="link" href="replication.html#sysvar_gtid_mode"><code class="literal">gtid_mode=ON</code></a>), do not
            enable binary logging by <a class="link" href="programs.html#mysql-upgrade" title="4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables"><span class="command"><strong>mysql_upgrade</strong></span></a>.
          </p></li><li class="listitem"><p><a name="option_mysql_upgrade_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysql_upgrade_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444430959232"></a><a class="indexterm" name="idm46444430957728"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-client"></a>4.5 Client Programs</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#mysql">4.5.1 <span class="command"><strong>mysql</strong></span> — The MySQL Command-Line Client</a></span></dt><dt><span class="section"><a href="programs.html#mysqladmin">4.5.2 <span class="command"><strong>mysqladmin</strong></span> — Client for Administering a MySQL Server</a></span></dt><dt><span class="section"><a href="programs.html#mysqlcheck">4.5.3 <span class="command"><strong>mysqlcheck</strong></span> — A Table Maintenance Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqldump">4.5.4 <span class="command"><strong>mysqldump</strong></span> — A Database Backup Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqlimport">4.5.5 <span class="command"><strong>mysqlimport</strong></span> — A Data Import Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqlpump">4.5.6 <span class="command"><strong>mysqlpump</strong></span> — A Database Backup Program</a></span></dt><dt><span class="section"><a href="programs.html#mysqlshow">4.5.7 <span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information</a></span></dt><dt><span class="section"><a href="programs.html#mysqlslap">4.5.8 <span class="command"><strong>mysqlslap</strong></span> — Load Emulation Client</a></span></dt></dl>
</div>
<p>
    This section describes client programs that connect to the MySQL
    server.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql"></a>4.5.1 <span class="command"><strong>mysql</strong></span> — The MySQL Command-Line Client</h3>

</div>

</div>

</div>

<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#mysql-command-options">4.5.1.1 mysql Client Options</a></span></dt><dt><span class="section"><a href="programs.html#mysql-commands">4.5.1.2 mysql Client Commands</a></span></dt><dt><span class="section"><a href="programs.html#mysql-logging">4.5.1.3 mysql Client Logging</a></span></dt><dt><span class="section"><a href="programs.html#mysql-server-side-help">4.5.1.4 mysql Client Server-Side Help</a></span></dt><dt><span class="section"><a href="programs.html#mysql-batch-commands">4.5.1.5 Executing SQL Statements from a Text File</a></span></dt><dt><span class="section"><a href="programs.html#mysql-tips">4.5.1.6 mysql Client Tips</a></span></dt></dl>
</div>
<a class="indexterm" name="idm46444430948000"></a><a class="indexterm" name="idm46444430947056"></a><a class="indexterm" name="idm46444430946112"></a><a class="indexterm" name="idm46444430944752"></a><a class="indexterm" name="idm46444430943424"></a><a class="indexterm" name="idm46444430942480"></a><p>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is a simple SQL shell with input line
        editing capabilities. It supports interactive and noninteractive
        use. When used interactively, query results are presented in an
        ASCII-table format. When used noninteractively (for example, as
        a filter), the result is presented in tab-separated format. The
        output format can be changed using command options.
      </p><p>
        If you have problems due to insufficient memory for large result
        sets, use the <a class="link" href="programs.html#option_mysql_quick"><code class="option">--quick</code></a> option. This
        forces <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to retrieve results from the
        server a row at a time rather than retrieving the entire result
        set and buffering it in memory before displaying it. This is
        done by returning the result set using the
        <a class="link" href="connectors-apis.html#mysql-use-result" title="28.7.6.81 mysql_use_result()"><code class="literal">mysql_use_result()</code></a> C API
        function in the client/server library rather than
        <a class="link" href="connectors-apis.html#mysql-store-result" title="28.7.6.79 mysql_store_result()"><code class="literal">mysql_store_result()</code></a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Alternatively, MySQL Shell offers access to the X DevAPI.
          For details, see <a class="ulink" href="https://dev.mysql.com/doc/mysql-shell/8.0/en/" target="_top">MySQL Shell 8.0 (part of MySQL 8.0)</a>.
</p>
</div>
<p>
        Using <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is very easy. Invoke it from the
        prompt of your command interpreter as follows:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql <em class="replaceable"><code>db_name</code></em></code></strong>
</pre><p>
        Or:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --user=<em class="replaceable"><code>user_name</code></em> --password <em class="replaceable"><code>db_name</code></em></code></strong>
Enter password: <em class="replaceable"><code>your_password</code></em>
</pre><p>
        Then type an SQL statement, end it with <code class="literal">;</code>,
        <code class="literal">\g</code>, or <code class="literal">\G</code> and press Enter.
      </p><p>
        Typing <span class="keycap"><strong>Control+C</strong></span> interrupts the current
        statement if there is one, or cancels any partial input line
        otherwise.
      </p><a class="indexterm" name="idm46444430921232"></a><a class="indexterm" name="idm46444430919744"></a><p>
        You can execute SQL statements in a script file (batch file)
        like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql <em class="replaceable"><code>db_name</code></em> &lt; <em class="replaceable"><code>script.sql</code></em> &gt; <em class="replaceable"><code>output.tab</code></em></code></strong>
</pre><p>
        On Unix, the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client logs statements
        executed interactively to a history file. See
        <a class="xref" href="programs.html#mysql-logging" title="4.5.1.3 mysql Client Logging">Section 4.5.1.3, “mysql Client Logging”</a>.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-command-options"></a>4.5.1.1 mysql Client Options</h4>
</div>
</div>
</div>
<a class="indexterm" name="idm46444430911312"></a><a class="indexterm" name="idm46444430910240"></a><a class="indexterm" name="idm46444430908752"></a><a class="indexterm" name="idm46444430906848"></a><p>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> supports the following options, which
        can be specified on the command line or in the
        <code class="literal">[mysql]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444430901456"></a><p class="title"><b>Table 4.11 mysql Client Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for the mysql client."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysql_auto-rehash">--auto-rehash</a></td>
<td>Enable automatic rehashing</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_auto-vertical-output">--auto-vertical-output</a></td>
<td>Enable automatic vertical result set display</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_batch">--batch</a></td>
<td>Do not use history file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_binary-as-hex">--binary-as-hex</a></td>
<td>Display binary values in hexadecimal notation</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_binary-mode">--binary-mode</a></td>
<td>Disable \r\n - to - \n translation and treatment of \0 as end-of-query</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_character-sets-dir">--character-sets-dir</a></td>
<td>Directory where character sets are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_column-names">--column-names</a></td>
<td>Write column names in results</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_column-type-info">--column-type-info</a></td>
<td>Display result set metadata</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_comments">--comments</a></td>
<td>Whether to retain or strip comments in statements sent to the server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_connect-expired-password">--connect-expired-password</a></td>
<td>Indicate to server that client can handle expired-password sandbox mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_connect-timeout">--connect-timeout</a></td>
<td>Number of seconds before connection timeout</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_database">--database</a></td>
<td>The database to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_debug">--debug</a></td>
<td>Write debugging log; supported only if MySQL was built with debugging support</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_delimiter">--delimiter</a></td>
<td>Set the statement delimiter</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_execute">--execute</a></td>
<td>Execute the statement and quit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_force">--force</a></td>
<td>Continue even if an SQL error occurs</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_histignore">--histignore</a></td>
<td>Patterns specifying which statements to ignore for logging</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_html">--html</a></td>
<td>Produce HTML output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ignore-spaces">--ignore-spaces</a></td>
<td>Ignore spaces after function names</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_init-command">--init-command</a></td>
<td>SQL statement to execute after connecting</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_line-numbers">--line-numbers</a></td>
<td>Write line numbers for errors</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_local-infile">--local-infile</a></td>
<td>Enable or disable for LOCAL capability for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_max-allowed-packet">--max-allowed-packet</a></td>
<td>Maximum packet length to send to or receive from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_max-join-size">--max-join-size</a></td>
<td>The automatic limit for rows in a join when using --safe-updates</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_named-commands">--named-commands</a></td>
<td>Enable named mysql commands</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_net-buffer-length">--net-buffer-length</a></td>
<td>Buffer size for TCP/IP and socket communication</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_no-auto-rehash">--no-auto-rehash</a></td>
<td>Disable automatic rehashing</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_no-beep">--no-beep</a></td>
<td>Do not beep when errors occur</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_one-database">--one-database</a></td>
<td>Ignore statements except those for the default database named on the command line</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_pager">--pager</a></td>
<td>Use the given command for paging query output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_prompt">--prompt</a></td>
<td>Set the prompt to the specified format</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_quick">--quick</a></td>
<td>Do not cache each query result</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_raw">--raw</a></td>
<td>Write column values without escape conversion</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_reconnect">--reconnect</a></td>
<td>If the connection to the server is lost, automatically try to reconnect</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_safe-updates">--safe-updates</a>, <a class="link" href="programs.html#option_mysql_safe-updates">--i-am-a-dummy</a></td>
<td>Allow only UPDATE and DELETE statements that specify key values</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_select-limit">--select-limit</a></td>
<td>The automatic limit for SELECT statements when using --safe-updates</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_show-warnings">--show-warnings</a></td>
<td>Show warnings after each statement if there are any</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_sigint-ignore">--sigint-ignore</a></td>
<td>Ignore SIGINT signals (typically the result of typing Control+C)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_silent">--silent</a></td>
<td>Silent mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_auto-rehash">--skip-auto-rehash</a></td>
<td>Disable automatic rehashing</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_skip-column-names">--skip-column-names</a></td>
<td>Do not write column names in results</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_skip-line-numbers">--skip-line-numbers</a></td>
<td>Skip line numbers for errors</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_named-commands">--skip-named-commands</a></td>
<td>Disable named mysql commands</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_pager">--skip-pager</a></td>
<td>Disable paging</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_reconnect">--skip-reconnect</a></td>
<td>Disable reconnecting</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_syslog">--syslog</a></td>
<td>Log interactive statements to syslog</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_table">--table</a></td>
<td>Display output in tabular format</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_tee">--tee</a></td>
<td>Append a copy of output to named file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_unbuffered">--unbuffered</a></td>
<td>Flush the buffer after each query</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_vertical">--vertical</a></td>
<td>Print query output rows vertically (one line per column value)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_wait">--wait</a></td>
<td>If the connection cannot be established, wait and retry instead of aborting</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_xml">--xml</a></td>
<td>Produce XML output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_help"></a>
            <a class="indexterm" name="idm46444430482016"></a>

            <a class="indexterm" name="idm46444430480560"></a>

            <a class="link" href="programs.html#option_mysql_help"><code class="option">--help</code></a>, <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysql_auto-rehash"></a>
            <a class="indexterm" name="idm46444430476016"></a>

            <a class="indexterm" name="idm46444430474528"></a>

            <a class="link" href="programs.html#option_mysql_auto-rehash"><code class="option">--auto-rehash</code></a>
          </p><p>
            Enable automatic rehashing. This option is on by default,
            which enables database, table, and column name completion.
            Use
            <a class="link" href="programs.html#option_mysql_auto-rehash"><code class="option">--disable-auto-rehash</code></a>
            to disable rehashing. That causes <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
            to start faster, but you must issue the
            <code class="literal">rehash</code> command or its
            <code class="literal">\#</code> shortcut if you want to use name
            completion.
          </p><p>
            To complete a name, enter the first part and press Tab. If
            the name is unambiguous, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> completes
            it. Otherwise, you can press Tab again to see the possible
            names that begin with what you have typed so far. Completion
            does not occur if there is no default database.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              This feature requires a MySQL client that is compiled with
              the <span class="bold"><strong>readline</strong></span> library.
              Typically, the <span class="bold"><strong>readline</strong></span>
              library is not available on Windows.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysql_auto-vertical-output"></a>
            <a class="indexterm" name="idm46444430462112"></a>

            <a class="indexterm" name="idm46444430460656"></a>

            <a class="link" href="programs.html#option_mysql_auto-vertical-output"><code class="option">--auto-vertical-output</code></a>
          </p><p>
            Cause result sets to be displayed vertically if they are too
            wide for the current window, and using normal tabular format
            otherwise. (This applies to statements terminated by
            <code class="literal">;</code> or <code class="literal">\G</code>.)
          </p></li><li class="listitem"><p><a name="option_mysql_batch"></a>
            <a class="indexterm" name="idm46444430454912"></a>

            <a class="indexterm" name="idm46444430453456"></a>

            <a class="link" href="programs.html#option_mysql_batch"><code class="option">--batch</code></a>, <code class="option">-B</code>
          </p><p>
            Print results using tab as the column separator, with each
            row on a new line. With this option,
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> does not use the history file.
          </p><p>
            Batch mode results in nontabular output format and escaping
            of special characters. Escaping may be disabled by using raw
            mode; see the description for the
            <a class="link" href="programs.html#option_mysql_raw"><code class="option">--raw</code></a> option.
          </p></li><li class="listitem"><p><a name="option_mysql_binary-as-hex"></a>
            <a class="indexterm" name="idm46444430446128"></a>

            <a class="indexterm" name="idm46444430444640"></a>

            <a class="link" href="programs.html#option_mysql_binary-as-hex"><code class="option">--binary-as-hex</code></a>
          </p><p>
            When this option is given, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> displays
            binary data using hexadecimal notation
            (<code class="literal">0x<em class="replaceable"><code>value</code></em></code>).
            This occurs whether the overall output dislay format is
            tabular, vertical, HTML, or XML.
          </p><p>
            As of MySQL 8.0.19, when <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> operates
            in interactive mode, this option is enabled by default. In
            addition, output from the <code class="literal">status</code> (or
            <code class="literal">\s</code>) command includes this line when the
            option is enabled implicitly or explicitly:
          </p><pre data-lang="none" class="programlisting">Binary data as: Hexadecimal</pre><p>
            To disable hexadecimal notation, use
            <a class="link" href="programs.html#option_mysql_binary-as-hex"><code class="option">--skip-binary-as-hex</code></a>
          </p></li><li class="listitem"><p><a name="option_mysql_binary-mode"></a>
            <a class="indexterm" name="idm46444430432416"></a>

            <a class="indexterm" name="idm46444430430928"></a>

            <a class="link" href="programs.html#option_mysql_binary-mode"><code class="option">--binary-mode</code></a>
          </p><p>
            This option helps when processing
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> output that may contain
            <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> values. By default,
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> translates <code class="literal">\r\n</code>
            in statement strings to <code class="literal">\n</code> and interprets
            <code class="literal">\0</code> as the statement terminator.
            <a class="link" href="programs.html#option_mysql_binary-mode"><code class="option">--binary-mode</code></a> disables both
            features. It also disables all <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
            commands except <code class="literal">charset</code> and
            <code class="literal">delimiter</code> in noninteractive mode (for
            input piped to <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> or loaded using the
            <code class="literal">source</code> command).
          </p></li><li class="listitem"><p><a name="option_mysql_bind-address"></a>
            <a class="indexterm" name="idm46444430415152"></a>

            <a class="indexterm" name="idm46444430413664"></a>

            <a class="link" href="programs.html#option_mysql_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysql_character-sets-dir"></a>
            <a class="indexterm" name="idm46444430409120"></a>

            <a class="indexterm" name="idm46444430407664"></a>

            <a class="link" href="programs.html#option_mysql_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_column-names"></a>
            <a class="indexterm" name="idm46444430402480"></a>

            <a class="indexterm" name="idm46444430400992"></a>

            <a class="link" href="programs.html#option_mysql_column-names"><code class="option">--column-names</code></a>
          </p><p>
            Write column names in results.
          </p></li><li class="listitem"><p><a name="option_mysql_column-type-info"></a>
            <a class="indexterm" name="idm46444430396864"></a>

            <a class="indexterm" name="idm46444430395376"></a>

            <a class="link" href="programs.html#option_mysql_column-type-info"><code class="option">--column-type-info</code></a>
          </p><p>
            Display result set metadata.
          </p></li><li class="listitem"><p><a name="option_mysql_comments"></a>
            <a class="indexterm" name="idm46444430391248"></a>

            <a class="indexterm" name="idm46444430389792"></a>

            <a class="link" href="programs.html#option_mysql_comments"><code class="option">--comments</code></a>,
            <code class="option">-c</code>
          </p><p>
            Whether to strip or preserve comments in statements sent to
            the server. The default is
            <a class="link" href="programs.html#option_mysql_comments"><code class="option">--skip-comments</code></a>
            (strip comments), enable with
            <a class="link" href="programs.html#option_mysql_comments"><code class="option">--comments</code></a> (preserve
            comments).
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client always passes
              optimizer hints to the server, regardless of whether this
              option is given.
            </p><p>
              Comment stripping is deprecated. This feature and the
              options to control it will be removed in a future MySQL
              release.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysql_compress"></a>
            <a class="indexterm" name="idm46444430380528"></a>

            <a class="indexterm" name="idm46444430379072"></a>

            <a class="link" href="programs.html#option_mysql_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysql_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444430371136"></a><a class="indexterm" name="idm46444430369632"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysql_connect-expired-password"></a>
            <a class="indexterm" name="idm46444430362752"></a>

            <a class="indexterm" name="idm46444430361296"></a>

            <a class="link" href="programs.html#option_mysql_connect-expired-password"><code class="option">--connect-expired-password</code></a>
          </p><p>
            Indicate to the server that the client can handle sandbox
            mode if the account used to connect has an expired password.
            This can be useful for noninteractive invocations of
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> because normally the server
            disconnects noninteractive clients that attempt to connect
            using an account with an expired password. (See
            <a class="xref" href="security.html#expired-password-handling" title="6.2.16 Server Handling of Expired Passwords">Section 6.2.16, “Server Handling of Expired Passwords”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysql_connect-timeout"></a>
            <a class="link" href="programs.html#option_mysql_connect-timeout"><code class="option">--connect-timeout=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444430353264"></a><a class="indexterm" name="idm46444430351776"></a><p>
            The number of seconds before connection timeout. (Default
            value is <code class="literal">0</code>.)
          </p></li><li class="listitem"><p><a name="option_mysql_database"></a>
            <a class="indexterm" name="idm46444430348000"></a>

            <a class="indexterm" name="idm46444430346544"></a>

            <a class="link" href="programs.html#option_mysql_database"><code class="option">--database=<em class="replaceable"><code>db_name</code></em></code></a>,
            <code class="option">-D <em class="replaceable"><code>db_name</code></em></code>
          </p><p>
            The database to use. This is useful primarily in an option
            file.
          </p></li><li class="listitem"><p><a name="option_mysql_debug"></a>
            <a class="indexterm" name="idm46444430341456"></a>

            <a class="indexterm" name="idm46444430340000"></a>

            <a class="link" href="programs.html#option_mysql_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is <code class="literal">d:t:o,/tmp/mysql.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysql_debug-check"></a>
            <a class="indexterm" name="idm46444430330432"></a>

            <a class="indexterm" name="idm46444430328944"></a>

            <a class="link" href="programs.html#option_mysql_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysql_debug-info"></a>
            <a class="indexterm" name="idm46444430322896"></a>

            <a class="indexterm" name="idm46444430321440"></a>

            <a class="link" href="programs.html#option_mysql_debug-info"><code class="option">--debug-info</code></a>,
            <code class="option">-T</code>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysql_default-auth"></a>
            <a class="indexterm" name="idm46444430314864"></a>

            <a class="indexterm" name="idm46444430313376"></a>

            <a class="link" href="programs.html#option_mysql_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_default-character-set"></a>
            <a class="indexterm" name="idm46444430308208"></a>

            <a class="indexterm" name="idm46444430306752"></a>

            <a class="link" href="programs.html#option_mysql_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set for the client and connection.
          </p><p>
            This option can be useful if the operating system uses one
            character set and the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client by
            default uses another. In this case, output may be formatted
            incorrectly. You can usually fix such issues by using this
            option to force the client to use the system character set
            instead.
          </p><p>
            For more information, see
            <a class="xref" href="charset.html#charset-connection" title="10.4 Connection Character Sets and Collations">Section 10.4, “Connection Character Sets and Collations”</a>, and
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444430297888"></a>

            <a class="indexterm" name="idm46444430296432"></a>

            <a class="link" href="programs.html#option_mysql_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_defaults-file"></a>
            <a class="indexterm" name="idm46444430290032"></a>

            <a class="indexterm" name="idm46444430288544"></a>

            <a class="link" href="programs.html#option_mysql_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444430280112"></a>

            <a class="indexterm" name="idm46444430278656"></a>

            <a class="link" href="programs.html#option_mysql_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> normally reads the
            <code class="literal">[client]</code> and <code class="literal">[mysql]</code>
            groups. If the
            <a class="link" href="programs.html#option_mysql_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysql_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_delimiter"></a>
            <a class="indexterm" name="idm46444430266128"></a>

            <a class="indexterm" name="idm46444430264672"></a>

            <a class="link" href="programs.html#option_mysql_delimiter"><code class="option">--delimiter=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Set the statement delimiter. The default is the semicolon
            character (<code class="literal">;</code>).
          </p></li><li class="listitem"><p><a name="option_mysql_disable-named-commands"></a>
            <a class="indexterm" name="idm46444430259536"></a>

            <a class="indexterm" name="idm46444430258048"></a>

            <a class="link" href="programs.html#option_mysql_disable-named-commands"><code class="option">--disable-named-commands</code></a>
          </p><p>
            Disable named commands. Use the <code class="literal">\*</code> form
            only, or use named commands only at the beginning of a line
            ending with a semicolon (<code class="literal">;</code>).
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> starts with this option
            <span class="emphasis"><em>enabled</em></span> by default. However, even with
            this option, long-format commands still work from the first
            line. See <a class="xref" href="programs.html#mysql-commands" title="4.5.1.2 mysql Client Commands">Section 4.5.1.2, “mysql Client Commands”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444430249728"></a>

            <a class="indexterm" name="idm46444430248272"></a>

            <a class="link" href="programs.html#option_mysql_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysql_execute"></a>
            <a class="indexterm" name="idm46444430242496"></a>

            <a class="indexterm" name="idm46444430241040"></a>

            <a class="link" href="programs.html#option_mysql_execute"><code class="option">--execute=<em class="replaceable"><code>statement</code></em></code></a>,
            <code class="option">-e <em class="replaceable"><code>statement</code></em></code>
          </p><p>
            Execute the statement and quit. The default output format is
            like that produced with
            <a class="link" href="programs.html#option_mysql_batch"><code class="option">--batch</code></a>. See
            <a class="xref" href="programs.html#command-line-options" title="4.2.2.1 Using Options on the Command Line">Section 4.2.2.1, “Using Options on the Command Line”</a>, for some examples.
            With this option, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> does not use the
            history file.
          </p></li><li class="listitem"><p><a name="option_mysql_force"></a>
            <a class="indexterm" name="idm46444430232992"></a>

            <a class="indexterm" name="idm46444430231536"></a>

            <a class="link" href="programs.html#option_mysql_force"><code class="option">--force</code></a>, <code class="option">-f</code>
          </p><p>
            Continue even if an SQL error occurs.
          </p></li><li class="listitem"><p><a name="option_mysql_get-server-public-key"></a>
            <a class="indexterm" name="idm46444430226944"></a>

            <a class="indexterm" name="idm46444430225488"></a>

            <a class="link" href="programs.html#option_mysql_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysql_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysql_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_histignore"></a>
            <a class="indexterm" name="idm46444430215344"></a>

            <a class="indexterm" name="idm46444430213888"></a>

            <a class="link" href="programs.html#option_mysql_histignore"><code class="option">--histignore</code></a>
          </p><p>
            A list of one or more colon-separated patterns specifying
            statements to ignore for logging purposes. These patterns
            are added to the default pattern list
            (<code class="literal">"*IDENTIFIED*:*PASSWORD*"</code>). The value
            specified for this option affects logging of statements
            written to the history file, and to
            <code class="literal">syslog</code> if the
            <a class="link" href="programs.html#option_mysql_syslog"><code class="option">--syslog</code></a> option is given. For
            more information, see <a class="xref" href="programs.html#mysql-logging" title="4.5.1.3 mysql Client Logging">Section 4.5.1.3, “mysql Client Logging”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_host"></a>
            <a class="indexterm" name="idm46444430206416"></a>

            <a class="indexterm" name="idm46444430204960"></a>

            <a class="link" href="programs.html#option_mysql_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysql_html"></a>
            <a class="indexterm" name="idm46444430199856"></a>

            <a class="indexterm" name="idm46444430198400"></a>

            <a class="link" href="programs.html#option_mysql_html"><code class="option">--html</code></a>, <code class="option">-H</code>
          </p><p>
            Produce HTML output.
          </p></li><li class="listitem"><p><a name="option_mysql_ignore-spaces"></a>
            <a class="indexterm" name="idm46444430193872"></a>

            <a class="indexterm" name="idm46444430192384"></a>

            <a class="link" href="programs.html#option_mysql_ignore-spaces"><code class="option">--ignore-spaces</code></a>,
            <code class="option">-i</code>
          </p><p>
            Ignore spaces after function names. The effect of this is
            described in the discussion for the
            <a class="link" href="server-administration.html#sqlmode_ignore_space"><code class="literal">IGNORE_SPACE</code></a> SQL mode (see
            <a class="xref" href="server-administration.html#sql-mode" title="5.1.11 Server SQL Modes">Section 5.1.11, “Server SQL Modes”</a>).
          </p></li><li class="listitem"><p><a name="option_mysql_init-command"></a>
            <a class="indexterm" name="idm46444430185776"></a>

            <a class="indexterm" name="idm46444430184288"></a>

            <a class="link" href="programs.html#option_mysql_init-command"><code class="option">--init-command=str</code></a>
          </p><p>
            SQL statement to execute after connecting to the server. If
            auto-reconnect is enabled, the statement is executed again
            after reconnection occurs.
          </p></li><li class="listitem"><p><a name="option_mysql_line-numbers"></a>
            <a class="indexterm" name="idm46444430180016"></a>

            <a class="indexterm" name="idm46444430178528"></a>

            <a class="link" href="programs.html#option_mysql_line-numbers"><code class="option">--line-numbers</code></a>
          </p><p>
            Write line numbers for errors. Disable this with
            <a class="link" href="programs.html#option_mysql_skip-line-numbers"><code class="option">--skip-line-numbers</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysql_load-data-local-dir"></a>
            <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><a class="indexterm" name="idm46444430171888"></a><a class="indexterm" name="idm46444430170432"></a><p>
            This option affects the client-side <code class="literal">LOCAL</code>
            capability for <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>
            operations. It specifies the directory in which files named
            in <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA
            LOCAL</code></a> statements must be located. The effect of
            <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a> depends
            on whether <code class="literal">LOCAL</code> data loading is enabled
            or disabled:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                If <code class="literal">LOCAL</code> data loading is enabled,
                either by default in the MySQL client library or by
                specifying
                <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile[=1]</code></a>, the
                <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a>
                option is ignored.
              </p></li><li class="listitem"><p>
                If <code class="literal">LOCAL</code> data loading is disabled,
                either by default in the MySQL client library or by
                specifying
                <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile=0</code></a>, the
                <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a>
                option applies.
</p></li></ul>
</div>
<p>
            When <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a>
            applies, the option value designates the directory in which
            local data files must be located. Comparison of the
            directory path name and the path name of files to be loaded
            is case-sensitive regardless of the case-sensitivity of the
            underlying file system. If the option value is the empty
            string, it names no directory, with the result that no files
            are permitted for local data loading.
          </p><p>
            For example, to explicitly disable local data loading except
            for files located in the <code class="filename">/my/local/data</code>
            directory, invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> like this:
          </p><pre data-lang="terminal" class="programlisting">mysql --local-infile=0 --load-data-local-dir=/my/local/data</pre><p>
            When both <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile</code></a> and
            <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a> are
            given, the order in which they are given does not matter.
          </p><p>
            Successful use of <code class="literal">LOCAL</code> load operations
            within <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> also requires that the
            server permits local loading; see
            <a class="xref" href="security.html#load-data-local-security" title="6.1.6 Security Considerations for LOAD DATA LOCAL">Section 6.1.6, “Security Considerations for LOAD DATA LOCAL”</a>
          </p><p>
            The <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a>
            option was added in MySQL 8.0.21.
          </p></li><li class="listitem"><p><a name="option_mysql_local-infile"></a>
            <a class="indexterm" name="idm46444430141680"></a>

            <a class="indexterm" name="idm46444430140192"></a>

            <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile[={0|1}]</code></a>
          </p><p>
            By default, <code class="literal">LOCAL</code> capability for
            <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a> is determined by
            the default compiled into the MySQL client library. To
            enable or disable <code class="literal">LOCAL</code> data loading
            explicitly, use the
            <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile</code></a> option. When
            given with no value, the option enables
            <code class="literal">LOCAL</code> data loading. When given as
            <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile=0</code></a> or
            <a class="link" href="programs.html#option_mysql_local-infile"><code class="option">--local-infile=1</code></a>, the option
            disables or enables <code class="literal">LOCAL</code> data loading.
          </p><p>
            If <code class="literal">LOCAL</code> capability is disabled, the
            <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a> option
            can be used to permit restricted local loading of files
            located in a designated directory.
          </p><p>
            Successful use of <code class="literal">LOCAL</code> load operations
            within <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> also requires that the
            server permits local loading; see
            <a class="xref" href="security.html#load-data-local-security" title="6.1.6 Security Considerations for LOAD DATA LOCAL">Section 6.1.6, “Security Considerations for LOAD DATA LOCAL”</a>
          </p></li><li class="listitem"><p><a name="option_mysql_login-path"></a>
            <a class="indexterm" name="idm46444430123280"></a>

            <a class="indexterm" name="idm46444430121824"></a>

            <a class="link" href="programs.html#option_mysql_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_max-allowed-packet"></a>
            <a class="link" href="programs.html#option_mysql_max-allowed-packet"><code class="option">--max-allowed-packet=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444430111568"></a><a class="indexterm" name="idm46444430110112"></a><p>
            The maximum size of the buffer for client/server
            communication. The default is 16MB, the maximum is 1GB.
          </p></li><li class="listitem"><p><a name="option_mysql_max-join-size"></a>
            <a class="link" href="programs.html#option_mysql_max-join-size"><code class="option">--max-join-size=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444430105536"></a><a class="indexterm" name="idm46444430104048"></a><p>
            The automatic limit for rows in a join when using
            <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a>. (Default value
            is 1,000,000.)
          </p></li><li class="listitem"><p><a name="option_mysql_named-commands"></a>
            <a class="indexterm" name="idm46444430099952"></a>

            <a class="indexterm" name="idm46444430098464"></a>

            <a class="link" href="programs.html#option_mysql_named-commands"><code class="option">--named-commands</code></a>,
            <code class="option">-G</code>
          </p><p>
            Enable named <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> commands. Long-format
            commands are permitted, not just short-format commands. For
            example, <code class="literal">quit</code> and <code class="literal">\q</code>
            both are recognized. Use
            <a class="link" href="programs.html#option_mysql_named-commands"><code class="option">--skip-named-commands</code></a>
            to disable named commands. See
            <a class="xref" href="programs.html#mysql-commands" title="4.5.1.2 mysql Client Commands">Section 4.5.1.2, “mysql Client Commands”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_net-buffer-length"></a>
            <a class="link" href="programs.html#option_mysql_net-buffer-length"><code class="option">--net-buffer-length=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444430088032"></a><a class="indexterm" name="idm46444430086576"></a><p>
            The buffer size for TCP/IP and socket communication.
            (Default value is 16KB.)
          </p></li><li class="listitem"><p><a name="option_mysql_no-auto-rehash"></a>
            <a class="indexterm" name="idm46444430083408"></a>

            <a class="indexterm" name="idm46444430081920"></a>

            <a class="link" href="programs.html#option_mysql_auto-rehash"><code class="option">--no-auto-rehash</code></a>,
            <code class="option">-A</code>
          </p><p>
            This has the same effect as
            <code class="option">--skip-auto-rehash</code>.
            See the description for
            <a class="link" href="programs.html#option_mysql_auto-rehash"><code class="option">--auto-rehash</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysql_no-beep"></a>
            <a class="indexterm" name="idm46444430075632"></a>

            <a class="indexterm" name="idm46444430074176"></a>

            <a class="link" href="programs.html#option_mysql_no-beep"><code class="option">--no-beep</code></a>, <code class="option">-b</code>
          </p><p>
            Do not beep when errors occur.
          </p></li><li class="listitem"><p><a name="option_mysql_no-defaults"></a>
            <a class="indexterm" name="idm46444430069648"></a>

            <a class="indexterm" name="idm46444430068160"></a>

            <a class="link" href="programs.html#option_mysql_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysql_no-defaults"><code class="option">--no-defaults</code></a> can be used to
            prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when <a class="link" href="programs.html#option_mysql_no-defaults"><code class="option">--no-defaults</code></a>
            is used. (<code class="filename">.mylogin.cnf</code> is created by
            the <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_one-database"></a>
            <a class="indexterm" name="idm46444430056768"></a>

            <a class="indexterm" name="idm46444430055280"></a>

            <a class="link" href="programs.html#option_mysql_one-database"><code class="option">--one-database</code></a>,
            <code class="option">-o</code>
          </p><p>
            Ignore statements except those that occur while the default
            database is the one named on the command line. This option
            is rudimentary and should be used with care. Statement
            filtering is based only on
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a> statements.
          </p><p>
            Initially, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> executes statements in
            the input because specifying a database
            <em class="replaceable"><code>db_name</code></em> on the command line is
            equivalent to inserting
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE
            <em class="replaceable"><code>db_name</code></em></code></a> at the
            beginning of the input. Then, for each
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a> statement encountered,
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> accepts or rejects following
            statements depending on whether the database named is the
            one on the command line. The content of the statements is
            immaterial.
          </p><p>
            Suppose that <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is invoked to process
            this set of statements:
          </p><pre data-lang="sql" class="programlisting">DELETE FROM db2.t2;
USE db2;
DROP TABLE db1.t1;
CREATE TABLE db1.t1 (i INT);
USE db1;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE db2.t1 (j INT);</pre><p>
            If the command line is <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql --force --one-database
            db1</strong></span></a>, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> handles the input as
            follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                The <a class="link" href="sql-statements.html#delete" title="13.2.2 DELETE Statement"><code class="literal">DELETE</code></a> statement is
                executed because the default database is
                <code class="literal">db1</code>, even though the statement names
                a table in a different database.
              </p></li><li class="listitem"><p>
                The <a class="link" href="sql-statements.html#drop-table" title="13.1.32 DROP TABLE Statement"><code class="literal">DROP TABLE</code></a> and
                <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a> statements
                are not executed because the default database is not
                <code class="literal">db1</code>, even though the statements name
                a table in <code class="literal">db1</code>.
              </p></li><li class="listitem"><p>
                The <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> and
                <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a> statements
                are executed because the default database is
                <code class="literal">db1</code>, even though the
                <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a> statement
                names a table in a different database.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_mysql_pager"></a>
            <a class="indexterm" name="idm46444430023856"></a>

            <a class="indexterm" name="idm46444430022400"></a>

            <a class="link" href="programs.html#option_mysql_pager"><code class="option">--pager[=<em class="replaceable"><code>command</code></em>]</code></a>
          </p><p>
            Use the given command for paging query output. If the
            command is omitted, the default pager is the value of your
            <code class="literal">PAGER</code> environment variable. Valid pagers
            are <span class="command"><strong>less</strong></span>, <span class="command"><strong>more</strong></span>,
            <span class="command"><strong>cat [&gt; filename]</strong></span>, and so forth. This
            option works only on Unix and only in interactive mode. To
            disable paging, use
            <a class="link" href="programs.html#option_mysql_pager"><code class="option">--skip-pager</code></a>.
            <a class="xref" href="programs.html#mysql-commands" title="4.5.1.2 mysql Client Commands">Section 4.5.1.2, “mysql Client Commands”</a>, discusses output paging
            further.
          </p></li><li class="listitem"><p><a name="option_mysql_password"></a>
            <a class="indexterm" name="idm46444430013072"></a>

            <a class="indexterm" name="idm46444430011616"></a>

            <a class="link" href="programs.html#option_mysql_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> prompts for one. If given, there
            must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysql_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> should not prompt for one, use the
            <a class="link" href="programs.html#option_mysql_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysql_pipe"></a>
            <a class="indexterm" name="idm46444429998960"></a>

            <a class="indexterm" name="idm46444429997504"></a>

            <a class="link" href="programs.html#option_mysql_pipe"><code class="option">--pipe</code></a>, <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysql_plugin-dir"></a>
            <a class="indexterm" name="idm46444429990192"></a>

            <a class="indexterm" name="idm46444429988736"></a>

            <a class="link" href="programs.html#option_mysql_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the <a class="link" href="programs.html#option_mysql_default-auth"><code class="option">--default-auth</code></a>
            option is used to specify an authentication plugin but
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_port"></a>
            <a class="indexterm" name="idm46444429981248"></a>

            <a class="indexterm" name="idm46444429979792"></a>

            <a class="indexterm" name="idm46444429978304"></a>

            <a class="link" href="programs.html#option_mysql_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysql_print-defaults"></a>
            <a class="indexterm" name="idm46444429973616"></a>

            <a class="indexterm" name="idm46444429972128"></a>

            <a class="link" href="programs.html#option_mysql_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_prompt"></a>
            <a class="indexterm" name="idm46444429966816"></a>

            <a class="indexterm" name="idm46444429965360"></a>

            <a class="link" href="programs.html#option_mysql_prompt"><code class="option">--prompt=<em class="replaceable"><code>format_str</code></em></code></a>
          </p><p>
            Set the prompt to the specified format. The default is
            <code class="literal">mysql&gt;</code>. The special sequences that the
            prompt can contain are described in
            <a class="xref" href="programs.html#mysql-commands" title="4.5.1.2 mysql Client Commands">Section 4.5.1.2, “mysql Client Commands”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_protocol"></a>
            <a class="indexterm" name="idm46444429959536"></a>

            <a class="indexterm" name="idm46444429958080"></a>

            <a class="link" href="programs.html#option_mysql_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_quick"></a>
            <a class="indexterm" name="idm46444429953120"></a>

            <a class="indexterm" name="idm46444429951664"></a>

            <a class="link" href="programs.html#option_mysql_quick"><code class="option">--quick</code></a>, <code class="option">-q</code>
          </p><p>
            Do not cache each query result, print each row as it is
            received. This may slow down the server if the output is
            suspended. With this option, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> does
            not use the history file.
          </p></li><li class="listitem"><p><a name="option_mysql_raw"></a>
            <a class="indexterm" name="idm46444429945744"></a>

            <a class="indexterm" name="idm46444429944288"></a>

            <a class="link" href="programs.html#option_mysql_raw"><code class="option">--raw</code></a>, <code class="option">-r</code>
          </p><p>
            For tabular output, the <span class="quote">“<span class="quote">boxing</span>”</span> around columns
            enables one column value to be distinguished from another.
            For nontabular output (such as is produced in batch mode or
            when the <a class="link" href="programs.html#option_mysql_batch"><code class="option">--batch</code></a> or
            <a class="link" href="programs.html#option_mysql_silent"><code class="option">--silent</code></a> option is given),
            special characters are escaped in the output so they can be
            identified easily. Newline, tab, <code class="literal">NUL</code>, and
            backslash are written as <code class="literal">\n</code>,
            <code class="literal">\t</code>, <code class="literal">\0</code>, and
            <code class="literal">\\</code>. The
            <a class="link" href="programs.html#option_mysql_raw"><code class="option">--raw</code></a> option disables this
            character escaping.
          </p><p>
            The following example demonstrates tabular versus nontabular
            output and the use of raw mode to disable escaping:
          </p><pre data-lang="sql" class="programlisting">% <strong class="userinput"><code>mysql</code></strong>
mysql&gt; SELECT CHAR(92);
+----------+
| CHAR(92) |
+----------+
| \        |
+----------+

% <strong class="userinput"><code>mysql -s</code></strong>
mysql&gt; SELECT CHAR(92);
CHAR(92)
\\

% <strong class="userinput"><code>mysql -s -r</code></strong>
mysql&gt; SELECT CHAR(92);
CHAR(92)
\
</pre></li><li class="listitem"><p><a name="option_mysql_reconnect"></a>
            <a class="indexterm" name="idm46444429928736"></a>

            <a class="indexterm" name="idm46444429927280"></a>

            <a class="link" href="programs.html#option_mysql_reconnect"><code class="option">--reconnect</code></a>
          </p><p>
            If the connection to the server is lost, automatically try
            to reconnect. A single reconnect attempt is made each time
            the connection is lost. To suppress reconnection behavior,
            use
            <a class="link" href="programs.html#option_mysql_reconnect"><code class="option">--skip-reconnect</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysql_safe-updates"></a>
            <a class="indexterm" name="idm46444429921984"></a>

            <a class="indexterm" name="idm46444429920496"></a>

            <a class="indexterm" name="idm46444429919008"></a>

            <a class="indexterm" name="idm46444429917520"></a>

            <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a>,
            <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--i-am-a-dummy</code></a>,
            <code class="option">-U</code>
          </p><p>
            If this option is enabled,
            <a class="link" href="sql-statements.html#update" title="13.2.13 UPDATE Statement"><code class="literal">UPDATE</code></a> and
            <a class="link" href="sql-statements.html#delete" title="13.2.2 DELETE Statement"><code class="literal">DELETE</code></a> statements that do not
            use a key in the <code class="literal">WHERE</code> clause or a
            <code class="literal">LIMIT</code> clause produce an error. In
            addition, restrictions are placed on
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> statements that
            produce (or are estimated to produce) very large result
            sets. If you have set this option in an option file, you can
            use
            <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--skip-safe-updates</code></a>
            on the command line to override it. For more information
            about this option, see <a class="xref" href="programs.html#safe-updates" title="Using Safe-Updates Mode (--safe-updates)">Using Safe-Updates Mode (--safe-updates)</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_select-limit"></a>
            <a class="link" href="programs.html#option_mysql_select-limit"><code class="option">--select-limit=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444429903184"></a><a class="indexterm" name="idm46444429901696"></a><p>
            The automatic limit for
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> statements when using
            <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a>. (Default value
            is 1,000.)
          </p></li><li class="listitem"><p><a name="option_mysql_server-public-key-path"></a>
            <a class="indexterm" name="idm46444429896384"></a>

            <a class="indexterm" name="idm46444429894928"></a>

            <a class="link" href="programs.html#option_mysql_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysql_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysql_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            This option is available only if MySQL was built using
            OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444429881856"></a>

            <a class="indexterm" name="idm46444429880400"></a>

            <a class="link" href="programs.html#option_mysql_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysql_show-warnings"></a>
            <a class="indexterm" name="idm46444429873248"></a>

            <a class="indexterm" name="idm46444429871760"></a>

            <a class="link" href="programs.html#option_mysql_show-warnings"><code class="option">--show-warnings</code></a>
          </p><p>
            Cause warnings to be shown after each statement if there are
            any. This option applies to interactive and batch mode.
          </p></li><li class="listitem"><p><a name="option_mysql_sigint-ignore"></a>
            <a class="indexterm" name="idm46444429867520"></a>

            <a class="indexterm" name="idm46444429866032"></a>

            <a class="link" href="programs.html#option_mysql_sigint-ignore"><code class="option">--sigint-ignore</code></a>
          </p><p>
            Ignore <code class="literal">SIGINT</code> signals (typically the
            result of typing <span class="keycap"><strong>Control+C</strong></span>).
          </p><p>
            Without this option, typing <span class="keycap"><strong>Control+C</strong></span>
            interrupts the current statement if there is one, or cancels
            any partial input line otherwise.
          </p><a class="indexterm" name="idm46444429860288"></a><a class="indexterm" name="idm46444429858800"></a><a class="indexterm" name="idm46444429857312"></a></li><li class="listitem"><p><a name="option_mysql_silent"></a>
            <a class="indexterm" name="idm46444429854720"></a>

            <a class="indexterm" name="idm46444429853264"></a>

            <a class="link" href="programs.html#option_mysql_silent"><code class="option">--silent</code></a>, <code class="option">-s</code>
          </p><p>
            Silent mode. Produce less output. This option can be given
            multiple times to produce less and less output.
          </p><p>
            This option results in nontabular output format and escaping
            of special characters. Escaping may be disabled by using raw
            mode; see the description for the
            <a class="link" href="programs.html#option_mysql_raw"><code class="option">--raw</code></a> option.
          </p></li><li class="listitem"><p><a name="option_mysql_skip-column-names"></a>
            <a class="indexterm" name="idm46444429847120"></a>

            <a class="indexterm" name="idm46444429845664"></a>

            <a class="link" href="programs.html#option_mysql_skip-column-names"><code class="option">--skip-column-names</code></a>,
            <code class="option">-N</code>
          </p><p>
            Do not write column names in results.
          </p></li><li class="listitem"><p><a name="option_mysql_skip-line-numbers"></a>
            <a class="indexterm" name="idm46444429841040"></a>

            <a class="indexterm" name="idm46444429839584"></a>

            <a class="link" href="programs.html#option_mysql_skip-line-numbers"><code class="option">--skip-line-numbers</code></a>,
            <code class="option">-L</code>
          </p><p>
            Do not write line numbers for errors. Useful when you want
            to compare result files that include error messages.
          </p></li><li class="listitem"><p><a name="option_mysql_socket"></a>
            <a class="indexterm" name="idm46444429834880"></a>

            <a class="indexterm" name="idm46444429833424"></a>

            <a class="link" href="programs.html#option_mysql_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl"></a>
            <a class="indexterm" name="idm46444429824352"></a>

            <a class="indexterm" name="idm46444429822896"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysql_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444429816944"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysql_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option differs
            from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysql_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> values
            are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysql_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysql_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysql_syslog"></a>
            <a class="indexterm" name="idm46444429799888"></a>

            <a class="indexterm" name="idm46444429798432"></a>

            <a class="link" href="programs.html#option_mysql_syslog"><code class="option">--syslog</code></a>, <code class="option">-j</code>
          </p><p>
            This option causes <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to send
            interactive statements to the system logging facility. On
            Unix, this is <code class="literal">syslog</code>; on Windows, it is
            the Windows Event Log. The destination where logged messages
            appear is system dependent. On Linux, the destination is
            often the <code class="filename">/var/log/messages</code> file.
          </p><p>
            Here is a sample of output generated on Linux by using
            <code class="option">--syslog</code>. This output is formatted for
            readability; each logged message actually takes a single
            line.
          </p><pre data-lang="none" class="programlisting">Mar  7 12:39:25 myhost MysqlClient[20824]:
  SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23,
  DB_SERVER:'127.0.0.1', DB:'--', QUERY:'USE test;'
Mar  7 12:39:28 myhost MysqlClient[20824]:
  SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23,
  DB_SERVER:'127.0.0.1', DB:'test', QUERY:'SHOW TABLES;'</pre><p>
            For more information, see <a class="xref" href="programs.html#mysql-logging" title="4.5.1.3 mysql Client Logging">Section 4.5.1.3, “mysql Client Logging”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_table"></a>
            <a class="indexterm" name="idm46444429787616"></a>

            <a class="indexterm" name="idm46444429786160"></a>

            <a class="link" href="programs.html#option_mysql_table"><code class="option">--table</code></a>, <code class="option">-t</code>
          </p><p>
            Display output in table format. This is the default for
            interactive use, but can be used to produce table output in
            batch mode.
          </p></li><li class="listitem"><p><a name="option_mysql_tee"></a>
            <a class="indexterm" name="idm46444429781552"></a>

            <a class="indexterm" name="idm46444429780096"></a>

            <a class="link" href="programs.html#option_mysql_tee"><code class="option">--tee=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Append a copy of output to the given file. This option works
            only in interactive mode. <a class="xref" href="programs.html#mysql-commands" title="4.5.1.2 mysql Client Commands">Section 4.5.1.2, “mysql Client Commands”</a>,
            discusses tee files further.
          </p></li><li class="listitem"><p><a name="option_mysql_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444429774864"></a>

            <a class="indexterm" name="idm46444429773408"></a>

            <a class="link" href="programs.html#option_mysql_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysql_tls-version"></a>
            <a class="indexterm" name="idm46444429767536"></a>

            <a class="indexterm" name="idm46444429766048"></a>

            <a class="link" href="programs.html#option_mysql_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysql_unbuffered"></a>
            <a class="indexterm" name="idm46444429760672"></a>

            <a class="indexterm" name="idm46444429759216"></a>

            <a class="link" href="programs.html#option_mysql_unbuffered"><code class="option">--unbuffered</code></a>,
            <code class="option">-n</code>
          </p><p>
            Flush the buffer after each query.
          </p></li><li class="listitem"><p><a name="option_mysql_user"></a>
            <a class="indexterm" name="idm46444429754688"></a>

            <a class="indexterm" name="idm46444429753232"></a>

            <a class="link" href="programs.html#option_mysql_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysql_verbose"></a>
            <a class="indexterm" name="idm46444429748080"></a>

            <a class="indexterm" name="idm46444429746624"></a>

            <a class="link" href="programs.html#option_mysql_verbose"><code class="option">--verbose</code></a>, <code class="option">-v</code>
          </p><p>
            Verbose mode. Produce more output about what the program
            does. This option can be given multiple times to produce
            more and more output. (For example, <code class="option">-v -v
            -v</code> produces table output format even in batch
            mode.)
          </p></li><li class="listitem"><p><a name="option_mysql_version"></a>
            <a class="indexterm" name="idm46444429741488"></a>

            <a class="indexterm" name="idm46444429740032"></a>

            <a class="link" href="programs.html#option_mysql_version"><code class="option">--version</code></a>, <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysql_vertical"></a>
            <a class="indexterm" name="idm46444429735536"></a>

            <a class="indexterm" name="idm46444429734080"></a>

            <a class="link" href="programs.html#option_mysql_vertical"><code class="option">--vertical</code></a>,
            <code class="option">-E</code>
          </p><p>
            Print query output rows vertically (one line per column
            value). Without this option, you can specify vertical output
            for individual statements by terminating them with
            <code class="literal">\G</code>.
          </p></li><li class="listitem"><p><a name="option_mysql_wait"></a>
            <a class="indexterm" name="idm46444429728656"></a>

            <a class="indexterm" name="idm46444429727200"></a>

            <a class="link" href="programs.html#option_mysql_wait"><code class="option">--wait</code></a>, <code class="option">-w</code>
          </p><p>
            If the connection cannot be established, wait and retry
            instead of aborting.
          </p></li><li class="listitem"><p><a name="option_mysql_xml"></a>
            <a class="indexterm" name="idm46444429722608"></a>

            <a class="indexterm" name="idm46444429721152"></a>

            <a class="link" href="programs.html#option_mysql_xml"><code class="option">--xml</code></a>, <code class="option">-X</code>
          </p><p>
            Produce XML output.
          </p><pre data-lang="xml" class="programlisting">&lt;field name="<em class="replaceable"><code>column_name</code></em>"&gt;NULL&lt;/field&gt;
</pre><p>
            The output when <a class="link" href="programs.html#option_mysql_xml"><code class="option">--xml</code></a> is used
            with <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> matches that of
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>
            <a class="link" href="programs.html#option_mysqldump_xml"><code class="option">--xml</code></a>. See
            <a class="xref" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program">Section 4.5.4, “<span class="command"><strong>mysqldump</strong></span> — A Database Backup Program”</a>, for details.
          </p><p>
            The XML output also uses an XML namespace, as shown here:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --xml -uroot -e "SHOW VARIABLES LIKE 'version%'"</code></strong>
&lt;?xml version="1.0"?&gt;

&lt;resultset statement="SHOW VARIABLES LIKE 'version%'" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;row&gt;
&lt;field name="Variable_name"&gt;version&lt;/field&gt;
&lt;field name="Value"&gt;5.0.40-debug&lt;/field&gt;
&lt;/row&gt;

&lt;row&gt;
&lt;field name="Variable_name"&gt;version_comment&lt;/field&gt;
&lt;field name="Value"&gt;Source distribution&lt;/field&gt;
&lt;/row&gt;

&lt;row&gt;
&lt;field name="Variable_name"&gt;version_compile_machine&lt;/field&gt;
&lt;field name="Value"&gt;i686&lt;/field&gt;
&lt;/row&gt;

&lt;row&gt;
&lt;field name="Variable_name"&gt;version_compile_os&lt;/field&gt;
&lt;field name="Value"&gt;suse-linux-gnu&lt;/field&gt;
&lt;/row&gt;
&lt;/resultset&gt;
</pre></li><li class="listitem"><p><a name="option_mysql_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysql_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444429705392"></a><a class="indexterm" name="idm46444429703888"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-commands"></a>4.5.1.2 mysql Client Commands</h4>

</div>

</div>

</div>
<p>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> sends each SQL statement that you issue
        to the server to be executed. There is also a set of commands
        that <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> itself interprets. For a list of
        these commands, type <code class="literal">help</code> or
        <code class="literal">\h</code> at the <code class="literal">mysql&gt;</code>
        prompt:
      </p><a class="indexterm" name="idm46444429691280"></a><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>help</code></strong>

List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
edit      (\e) Edit command with $EDITOR.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
nopager   (\n) Disable pager, print to stdout.
notee     (\t) Don't write into outfile.
pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
system    (\!) Execute a system shell command.
tee       (\T) Set outfile [to_outfile]. Append everything into given
               outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing
               binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
resetconnection(\x) Clean session context.

For server side help, type 'help contents'
</pre><p>
        If <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is invoked with the
        <a class="link" href="programs.html#option_mysql_binary-mode"><code class="option">--binary-mode</code></a> option, all
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> commands are disabled except
        <code class="literal">charset</code> and <code class="literal">delimiter</code> in
        noninteractive mode (for input piped to <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
        or loaded using the <code class="literal">source</code> command).
      </p><p>
        Each command has both a long and short form. The long form is
        not case-sensitive; the short form is. The long form can be
        followed by an optional semicolon terminator, but the short form
        should not.
      </p><p>
        The use of short-form commands within multiple-line <code class="literal">/*
        ... */</code> comments is not supported. Short-form commands
        do work within single-line <code class="literal">/*! ... */</code> version
        comments, as do <code class="literal">/*+ ... */</code> optimizer-hint
        comments, which are stored in object definitions. If there is a
        concern that optimizer-hint comments may be stored in object
        definitions so that dump files when reloaded with
        <code class="literal">mysql</code> would result in execution of such
        commands, either invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> with the
        <a class="link" href="programs.html#option_mysql_binary-mode"><code class="option">--binary-mode</code></a> option or use a
        reload client other than <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="indexterm" name="idm46444429670032"></a>

            <a class="indexterm" name="idm46444429668544"></a>

            <code class="literal">help [<em class="replaceable"><code>arg</code></em>]</code>,
            <code class="literal">\h [<em class="replaceable"><code>arg</code></em>]</code>,
            <code class="literal">\? [<em class="replaceable"><code>arg</code></em>]</code>,
            <code class="literal">? [<em class="replaceable"><code>arg</code></em>]</code>
          </p><p>
            Display a help message listing the available
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> commands.
          </p><p>
            If you provide an argument to the <code class="literal">help</code>
            command, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> uses it as a search string
            to access server-side help from the contents of the MySQL
            Reference Manual. For more information, see
            <a class="xref" href="programs.html#mysql-server-side-help" title="4.5.1.4 mysql Client Server-Side Help">Section 4.5.1.4, “mysql Client Server-Side Help”</a>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429656800"></a>

            <a class="indexterm" name="idm46444429655312"></a>

            <code class="literal">charset
            <em class="replaceable"><code>charset_name</code></em></code>,
            <code class="literal">\C
            <em class="replaceable"><code>charset_name</code></em></code>
          </p><p>
            Change the default character set and issue a
            <a class="link" href="sql-statements.html#set-names" title="13.7.6.3 SET NAMES Statement"><code class="literal">SET NAMES</code></a> statement. This
            enables the character set to remain synchronized on the
            client and server if <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is run with
            auto-reconnect enabled (which is not recommended), because
            the specified character set is used for reconnects.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429647728"></a>

            <a class="indexterm" name="idm46444429646240"></a>

            <code class="literal">clear</code>, <code class="literal">\c</code>
          </p><p>
            Clear the current input. Use this if you change your mind
            about executing the statement that you are entering.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429642096"></a>

            <a class="indexterm" name="idm46444429640608"></a>

            <code class="literal">connect [<em class="replaceable"><code>db_name</code></em>
            <em class="replaceable"><code>host_name</code></em>]]</code>,
            <code class="literal">\r [<em class="replaceable"><code>db_name</code></em>
            <em class="replaceable"><code>host_name</code></em>]]</code>
          </p><p>
            Reconnect to the server. The optional database name and host
            name arguments may be given to specify the default database
            or the host where the server is running. If omitted, the
            current values are used.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429634576"></a>

            <a class="indexterm" name="idm46444429633088"></a>

            <code class="literal">delimiter <em class="replaceable"><code>str</code></em></code>,
            <code class="literal">\d <em class="replaceable"><code>str</code></em></code>
          </p><p>
            Change the string that <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> interprets
            as the separator between SQL statements. The default is the
            semicolon character (<code class="literal">;</code>).
          </p><p>
            The delimiter string can be specified as an unquoted or
            quoted argument on the <code class="literal">delimiter</code> command
            line. Quoting can be done with either single quote
            (<code class="literal">'</code>), double quote (<code class="literal">"</code>),
            or backtick (<code class="literal">`</code>) characters. To include a
            quote within a quoted string, either quote the string with a
            different quote character or escape the quote with a
            backslash (<code class="literal">\</code>) character. Backslash should
            be avoided outside of quoted strings because it is the
            escape character for MySQL. For an unquoted argument, the
            delimiter is read up to the first space or end of line. For
            a quoted argument, the delimiter is read up to the matching
            quote on the line.
          </p><p>
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> interprets instances of the
            delimiter string as a statement delimiter anywhere it
            occurs, except within quoted strings. Be careful about
            defining a delimiter that might occur within other words.
            For example, if you define the delimiter as
            <code class="literal">X</code>, you will be unable to use the word
            <code class="literal">INDEX</code> in statements.
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> interprets this as
            <code class="literal">INDE</code> followed by the delimiter
            <code class="literal">X</code>.
          </p><p>
            When the delimiter recognized by <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> is
            set to something other than the default of
            <code class="literal">;</code>, instances of that character are sent
            to the server without interpretation. However, the server
            itself still interprets <code class="literal">;</code> as a statement
            delimiter and processes statements accordingly. This
            behavior on the server side comes into play for
            multiple-statement execution (see
            <a class="xref" href="connectors-apis.html#c-api-multiple-queries" title="28.7.22 C API Multiple Statement Execution Support">Section 28.7.22, “C API Multiple Statement Execution Support”</a>), and for parsing
            the body of stored procedures and functions, triggers, and
            events (see <a class="xref" href="stored-objects.html#stored-programs-defining" title="24.1 Defining Stored Programs">Section 24.1, “Defining Stored Programs”</a>).
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429610624"></a>

            <a class="indexterm" name="idm46444429609136"></a>

            <code class="literal">edit</code>, <code class="literal">\e</code>
          </p><p>
            Edit the current input statement. <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
            checks the values of the <code class="literal">EDITOR</code> and
            <code class="literal">VISUAL</code> environment variables to determine
            which editor to use. The default editor is
            <span class="command"><strong>vi</strong></span> if neither variable is set.
          </p><p>
            The <code class="literal">edit</code> command works only in Unix.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429600464"></a>

            <a class="indexterm" name="idm46444429598976"></a>

            <code class="literal">ego</code>, <code class="literal">\G</code>
          </p><p>
            Send the current statement to the server to be executed and
            display the result using vertical format.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429594816"></a>

            <a class="indexterm" name="idm46444429593328"></a>

            <code class="literal">exit</code>, <code class="literal">\q</code>
          </p><p>
            Exit <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429588080"></a>

            <a class="indexterm" name="idm46444429586592"></a>

            <code class="literal">go</code>, <code class="literal">\g</code>
          </p><p>
            Send the current statement to the server to be executed.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429582544"></a>

            <a class="indexterm" name="idm46444429581056"></a>

            <code class="literal">nopager</code>, <code class="literal">\n</code>
          </p><p>
            Disable output paging. See the description for
            <code class="literal">pager</code>.
          </p><p>
            The <code class="literal">nopager</code> command works only in Unix.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429575104"></a>

            <a class="indexterm" name="idm46444429573616"></a>

            <code class="literal">notee</code>, <code class="literal">\t</code>
          </p><p>
            Disable output copying to the tee file. See the description
            for <code class="literal">tee</code>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429568832"></a>

            <a class="indexterm" name="idm46444429567344"></a>

            <code class="literal">nowarning</code>, <code class="literal">\w</code>
          </p><p>
            Disable display of warnings after each statement.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429563264"></a>

            <a class="indexterm" name="idm46444429561776"></a>

            <code class="literal">pager
            [<em class="replaceable"><code>command</code></em>]</code>, <code class="literal">\P
            [<em class="replaceable"><code>command</code></em>]</code>
          </p><p>
            Enable output paging. By using the
            <a class="link" href="programs.html#option_mysql_pager"><code class="option">--pager</code></a> option when you invoke
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, it is possible to browse or search
            query results in interactive mode with Unix programs such as
            <span class="command"><strong>less</strong></span>, <span class="command"><strong>more</strong></span>, or any
            other similar program. If you specify no value for the
            option, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> checks the value of the
            <code class="literal">PAGER</code> environment variable and sets the
            pager to that. Pager functionality works only in interactive
            mode.
          </p><p>
            Output paging can be enabled interactively with the
            <code class="literal">pager</code> command and disabled with
            <code class="literal">nopager</code>. The command takes an optional
            argument; if given, the paging program is set to that. With
            no argument, the pager is set to the pager that was set on
            the command line, or <code class="literal">stdout</code> if no pager
            was specified.
          </p><p>
            Output paging works only in Unix because it uses the
            <code class="literal">popen()</code> function, which does not exist on
            Windows. For Windows, the <code class="literal">tee</code> option can
            be used instead to save query output, although it is not as
            convenient as <code class="literal">pager</code> for browsing output
            in some situations.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429545248"></a>

            <a class="indexterm" name="idm46444429543760"></a>

            <code class="literal">print</code>, <code class="literal">\p</code>
          </p><p>
            Print the current input statement without executing it.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429539632"></a>

            <a class="indexterm" name="idm46444429538144"></a>

            <code class="literal">prompt [<em class="replaceable"><code>str</code></em>]</code>,
            <code class="literal">\R [<em class="replaceable"><code>str</code></em>]</code>
          </p><p>
            Reconfigure the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> prompt to the given
            string. The special character sequences that can be used in
            the prompt are described later in this section.
          </p><p>
            If you specify the <code class="literal">prompt</code> command with no
            argument, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> resets the prompt to the
            default of <code class="literal">mysql&gt;</code>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429528752"></a>

            <a class="indexterm" name="idm46444429527264"></a>

            <code class="literal">quit</code>, <code class="literal">\q</code>
          </p><p>
            Exit <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429522016"></a>

            <a class="indexterm" name="idm46444429520528"></a>

            <code class="literal">rehash</code>, <code class="literal">\#</code>
          </p><p>
            Rebuild the completion hash that enables database, table,
            and column name completion while you are entering
            statements. (See the description for the
            <a class="link" href="programs.html#option_mysql_auto-rehash"><code class="option">--auto-rehash</code></a> option.)
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429515296"></a>

            <a class="indexterm" name="idm46444429513808"></a>

            <code class="literal">resetconnection</code>, <code class="literal">\x</code>
          </p><p>
            Reset the connection to clear the session state.
          </p><p>
            Resetting a connection has effects similar to
            <a class="link" href="connectors-apis.html#mysql-change-user" title="28.7.6.3 mysql_change_user()"><code class="literal">mysql_change_user()</code></a> or an
            auto-reconnect except that the connection is not closed and
            reopened, and re-authentication is not done. See
            <a class="xref" href="connectors-apis.html#mysql-change-user" title="28.7.6.3 mysql_change_user()">Section 28.7.6.3, “mysql_change_user()”</a>, and
            <a class="xref" href="connectors-apis.html#c-api-auto-reconnect" title="28.7.27 C API Automatic Reconnection Control">Section 28.7.27, “C API Automatic Reconnection Control”</a>.
          </p><p>
            This example shows how <code class="literal">resetconnection</code>
            clears a value maintained in the session state:
          </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT LAST_INSERT_ID(3);</code></strong>
+-------------------+
| LAST_INSERT_ID(3) |
+-------------------+
|                 3 |
+-------------------+

mysql&gt; <strong class="userinput"><code>SELECT LAST_INSERT_ID();</code></strong>
+------------------+
| LAST_INSERT_ID() |
+------------------+
|                3 |
+------------------+

mysql&gt; <strong class="userinput"><code>resetconnection;</code></strong>

mysql&gt; <strong class="userinput"><code>SELECT LAST_INSERT_ID();</code></strong>
+------------------+
| LAST_INSERT_ID() |
+------------------+
|                0 |
+------------------+
</pre></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429500672"></a>

            <a class="indexterm" name="idm46444429499184"></a>

            <code class="literal">source
            <em class="replaceable"><code>file_name</code></em></code>, <code class="literal">\.
            <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            Read the named file and executes the statements contained
            therein. On Windows, specify path name separators as
            <code class="literal">/</code> or <code class="literal">\\</code>.
          </p><p>
            Quote characters are taken as part of the file name itself.
            For best results, the name should not include space
            characters.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429492480"></a>

            <a class="indexterm" name="idm46444429490992"></a>

            <code class="literal">status</code>, <code class="literal">\s</code>
          </p><p>
            Provide status information about the connection and the
            server you are using. If you are running with
            <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a> enabled,
            <code class="literal">status</code> also prints the values for the
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> variables that affect your queries.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429483840"></a>

            <a class="indexterm" name="idm46444429482352"></a>

            <code class="literal">system
            <em class="replaceable"><code>command</code></em></code>, <code class="literal">\!
            <em class="replaceable"><code>command</code></em></code>
          </p><p>
            Execute the given command using your default command
            interpreter.
          </p><p>
            Prior to MySQL 8.0.19, the <code class="literal">system</code> command
            works only in Unix. As of 8.0.19, it also works on Windows.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429476400"></a>

            <a class="indexterm" name="idm46444429474912"></a>

            <code class="literal">tee
            [<em class="replaceable"><code>file_name</code></em>]</code>,
            <code class="literal">\T [<em class="replaceable"><code>file_name</code></em>]</code>
          </p><p>
            By using the <a class="link" href="programs.html#option_mysql_tee"><code class="option">--tee</code></a> option when
            you invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, you can log statements
            and their output. All the data displayed on the screen is
            appended into a given file. This can be very useful for
            debugging purposes also. <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> flushes
            results to the file after each statement, just before it
            prints its next prompt. Tee functionality works only in
            interactive mode.
          </p><p>
            You can enable this feature interactively with the
            <code class="literal">tee</code> command. Without a parameter, the
            previous file is used. The <code class="literal">tee</code> file can
            be disabled with the <code class="literal">notee</code> command.
            Executing <code class="literal">tee</code> again re-enables logging.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429462784"></a>

            <a class="indexterm" name="idm46444429461296"></a>

            <code class="literal">use <em class="replaceable"><code>db_name</code></em></code>,
            <code class="literal">\u <em class="replaceable"><code>db_name</code></em></code>
          </p><p>
            Use <em class="replaceable"><code>db_name</code></em> as the default
            database.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444429456144"></a>

            <a class="indexterm" name="idm46444429454656"></a>

            <code class="literal">warnings</code>, <code class="literal">\W</code>
          </p><p>
            Enable display of warnings after each statement (if there
            are any).
</p></li></ul>
</div>
<p>
        Here are a few tips about the <code class="literal">pager</code> command:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            You can use it to write to a file and the results go only to
            the file:
          </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>pager cat &gt; /tmp/log.txt</code></strong>
</pre><p>
            You can also pass any options for the program that you want
            to use as your pager:
          </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>pager less -n -i -S</code></strong>
</pre></li><li class="listitem"><p>
            In the preceding example, note the <code class="option">-S</code>
            option. You may find it very useful for browsing wide query
            results. Sometimes a very wide result set is difficult to
            read on the screen. The <code class="option">-S</code> option to
            <span class="command"><strong>less</strong></span> can make the result set much more
            readable because you can scroll it horizontally using the
            left-arrow and right-arrow keys. You can also use
            <code class="option">-S</code> interactively within
            <span class="command"><strong>less</strong></span> to switch the horizontal-browse mode
            on and off. For more information, read the
            <span class="command"><strong>less</strong></span> manual page:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>man less</code></strong>
</pre></li><li class="listitem"><p>
            The <code class="option">-F</code> and <code class="option">-X</code> options may
            be used with <span class="command"><strong>less</strong></span> to cause it to exit if
            output fits on one screen, which is convenient when no
            scrolling is necessary:
          </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>pager less -n -i -S -F -X</code></strong>
</pre></li><li class="listitem"><p>
            You can specify very complex pager commands for handling
            query output:
          </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>pager cat | tee /dr1/tmp/res.txt \</code></strong>
          <strong class="userinput"><code>| tee /dr2/tmp/res2.txt | less -n -i -S</code></strong>
</pre><p>
            In this example, the command would send query results to two
            files in two different directories on two different file
            systems mounted on <code class="filename">/dr1</code> and
            <code class="filename">/dr2</code>, yet still display the results
            onscreen using <span class="command"><strong>less</strong></span>.
</p></li></ul>
</div>
<p>
        You can also combine the <code class="literal">tee</code> and
        <code class="literal">pager</code> functions. Have a
        <code class="literal">tee</code> file enabled and <code class="literal">pager</code>
        set to <span class="command"><strong>less</strong></span>, and you are able to browse the
        results using the <span class="command"><strong>less</strong></span> program and still have
        everything appended into a file the same time. The difference
        between the Unix <code class="literal">tee</code> used with the
        <code class="literal">pager</code> command and the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> built-in <code class="literal">tee</code> command
        is that the built-in <code class="literal">tee</code> works even if you do
        not have the Unix <span class="command"><strong>tee</strong></span> available. The built-in
        <code class="literal">tee</code> also logs everything that is printed on
        the screen, whereas the Unix <span class="command"><strong>tee</strong></span> used with
        <code class="literal">pager</code> does not log quite that much.
        Additionally, <code class="literal">tee</code> file logging can be turned
        on and off interactively from within <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>.
        This is useful when you want to log some queries to a file, but
        not others.
      </p><a class="indexterm" name="idm46444429414240"></a><p>
        The <code class="literal">prompt</code> command reconfigures the default
        <code class="literal">mysql&gt;</code> prompt. The string for defining the
        prompt can contain the following special sequences.
</p>
<div class="informaltable">
<table summary="prompt command options that are used to configure the mysql&gt; prompt."><col width="15%"><col width="75%"><thead><tr>
            <th scope="col">Option</th>
            <th scope="col">Description</th>
          </tr></thead><tbody><tr>
            <td scope="row"><code class="literal">\C</code></td>
            <td>The current connection identifier</td>
          </tr><tr>
            <td scope="row"><code class="literal">\c</code></td>
            <td>A counter that increments for each statement you issue</td>
          </tr><tr>
            <td scope="row"><code class="literal">\D</code></td>
            <td>The full current date</td>
          </tr><tr>
            <td scope="row"><code class="literal">\d</code></td>
            <td>The default database</td>
          </tr><tr>
            <td scope="row"><code class="literal">\h</code></td>
            <td>The server host</td>
          </tr><tr>
            <td scope="row"><code class="literal">\l</code></td>
            <td>The current delimiter</td>
          </tr><tr>
            <td scope="row"><code class="literal">\m</code></td>
            <td>Minutes of the current time</td>
          </tr><tr>
            <td scope="row"><code class="literal">\n</code></td>
            <td>A newline character</td>
          </tr><tr>
            <td scope="row"><code class="literal">\O</code></td>
            <td>The current month in three-letter format (Jan, Feb, …)</td>
          </tr><tr>
            <td scope="row"><code class="literal">\o</code></td>
            <td>The current month in numeric format</td>
          </tr><tr>
            <td scope="row"><code class="literal">\P</code></td>
            <td>am/pm</td>
          </tr><tr>
            <td scope="row"><code class="literal">\p</code></td>
            <td>The current TCP/IP port or socket file</td>
          </tr><tr>
            <td scope="row"><code class="literal">\R</code></td>
            <td>The current time, in 24-hour military time (0–23)</td>
          </tr><tr>
            <td scope="row"><code class="literal">\r</code></td>
            <td>The current time, standard 12-hour time (1–12)</td>
          </tr><tr>
            <td scope="row"><code class="literal">\S</code></td>
            <td>Semicolon</td>
          </tr><tr>
            <td scope="row"><code class="literal">\s</code></td>
            <td>Seconds of the current time</td>
          </tr><tr>
            <td scope="row"><code class="literal">\t</code></td>
            <td>A tab character</td>
          </tr><tr>
            <td scope="row"><code class="literal">\U</code></td>
            <td><p>
                Your full
                <code class="literal"><em class="replaceable"><code>user_name</code></em>@<em class="replaceable"><code>host_name</code></em></code>
                account name
              </p></td>
          </tr><tr>
            <td scope="row"><code class="literal">\u</code></td>
            <td>Your user name</td>
          </tr><tr>
            <td scope="row"><code class="literal">\v</code></td>
            <td>The server version</td>
          </tr><tr>
            <td scope="row"><code class="literal">\w</code></td>
            <td>The current day of the week in three-letter format (Mon, Tue, …)</td>
          </tr><tr>
            <td scope="row"><code class="literal">\Y</code></td>
            <td>The current year, four digits</td>
          </tr><tr>
            <td scope="row"><code class="literal">\y</code></td>
            <td>The current year, two digits</td>
          </tr><tr>
            <td scope="row"><code class="literal">\_</code></td>
            <td>A space</td>
          </tr><tr>
            <td scope="row"><code class="literal">\ </code></td>
            <td>A space (a space follows the backslash)</td>
          </tr><tr>
            <td scope="row"><code class="literal">\'</code></td>
            <td>Single quote</td>
          </tr><tr>
            <td scope="row"><code class="literal">\"</code></td>
            <td>Double quote</td>
          </tr><tr>
            <td scope="row"><code class="literal">\\</code></td>
            <td>A literal <code class="literal">\</code> backslash character</td>
          </tr><tr>
            <td scope="row"><code class="literal">\<em class="replaceable"><code>x</code></em></code></td>
            <td><p>
                <em class="replaceable"><code>x</code></em>, for any
                <span class="quote">“<span class="quote"><em class="replaceable"><code>x</code></em></span>”</span> not listed
                above
              </p></td>
</tr></tbody></table>
</div>
<p>
        You can set the prompt in several ways:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <span class="emphasis"><em>Use an environment variable.</em></span> You can
            set the <code class="literal">MYSQL_PS1</code> environment variable to
            a prompt string. For example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>export MYSQL_PS1="(\u@\h) [\d]&gt; "</code></strong>
</pre></li><li class="listitem"><p>
            <span class="emphasis"><em>Use a command-line option.</em></span> You can set
            the <a class="link" href="programs.html#option_mysql_prompt"><code class="option">--prompt</code></a> option on the
            command line to <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>. For example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --prompt="(\u@\h) [\d]&gt; "</code></strong>
(user@host) [database]&gt;
</pre></li><li class="listitem"><p>
            <span class="emphasis"><em>Use an option file.</em></span> You can set the
            <code class="literal">prompt</code> option in the
            <code class="literal">[mysql]</code> group of any MySQL option file,
            such as <code class="filename">/etc/my.cnf</code> or the
            <code class="filename">.my.cnf</code> file in your home directory.
            For example:
          </p><pre data-lang="ini" class="programlisting">[mysql]
prompt=(\\u@\\h) [\\d]&gt;\\_</pre><p>
            In this example, note that the backslashes are doubled. If
            you set the prompt using the <code class="literal">prompt</code>
            option in an option file, it is advisable to double the
            backslashes when using the special prompt options. There is
            some overlap in the set of permissible prompt options and
            the set of special escape sequences that are recognized in
            option files. (The rules for escape sequences in option
            files are listed in <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.) The
            overlap may cause you problems if you use single
            backslashes. For example, <code class="literal">\s</code> is
            interpreted as a space rather than as the current seconds
            value. The following example shows how to define a prompt
            within an option file to include the current time in
            <code class="literal"><em class="replaceable"><code>hh:mm:ss</code></em>&gt;</code>
            format:
          </p><pre data-lang="ini" class="programlisting">[mysql]
prompt="\\r:\\m:\\s&gt; "</pre></li><li class="listitem"><p>
            <span class="emphasis"><em>Set the prompt interactively.</em></span> You can
            change your prompt interactively by using the
            <code class="literal">prompt</code> (or <code class="literal">\R</code>)
            command. For example:
          </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>prompt (\u@\h) [\d]&gt;\_</code></strong>
PROMPT set to '(\u@\h) [\d]&gt;\_'
(<em class="replaceable"><code>user</code></em>@<em class="replaceable"><code>host</code></em>) [<em class="replaceable"><code>database</code></em>]&gt;
(<em class="replaceable"><code>user</code></em>@<em class="replaceable"><code>host</code></em>) [<em class="replaceable"><code>database</code></em>]&gt; prompt
Returning to default PROMPT of mysql&gt;
mysql&gt;<strong class="userinput"><code></code></strong>
</pre></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-logging"></a>4.5.1.3 mysql Client Logging</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444429291136"></a><a class="indexterm" name="idm46444429290048"></a><a class="indexterm" name="idm46444429288560"></a><a class="indexterm" name="idm46444429287472"></a><a class="indexterm" name="idm46444429285984"></a><a class="indexterm" name="idm46444429284896"></a><a class="indexterm" name="idm46444429283408"></a><a class="indexterm" name="idm46444429282336"></a><a class="indexterm" name="idm46444429280848"></a><p>
        The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client can do these types of
        logging for statements executed interactively:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            On Unix, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> writes the statements to a
            history file. By default, this file is named
            <code class="filename">.mysql_history</code> in your home directory.
            To specify a different file, set the value of the
            <code class="literal">MYSQL_HISTFILE</code> environment variable.
          </p></li><li class="listitem"><p>
            On all platforms, if the <code class="option">--syslog</code> option is
            given, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> writes the statements to the
            system logging facility. On Unix, this is
            <code class="literal">syslog</code>; on Windows, it is the Windows
            Event Log. The destination where logged messages appear is
            system dependent. On Linux, the destination is often the
            <code class="filename">/var/log/messages</code> file.
</p></li></ul>
</div>
<p>
        The following discussion describes characteristics that apply to
        all logging types and provides information specific to each
        logging type.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#mysql-logging-how-logging-occurs" title="How Logging Occurs">How Logging Occurs</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysql-logging-history-file" title="Controlling the History File">Controlling the History File</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysql-logging-syslog" title="syslog Logging Characteristics">syslog Logging Characteristics</a></p></li></ul>
</div>
<h5><a name="mysql-logging-how-logging-occurs"></a>How Logging Occurs</h5>
<p>
        For each enabled logging destination, statement logging occurs
        as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Statements are logged only when executed interactively.
            Statements are noninteractive, for example, when read from a
            file or a pipe. It is also possible to suppress statement
            logging by using the <a class="link" href="programs.html#option_mysql_batch"><code class="option">--batch</code></a>
            or <a class="link" href="programs.html#option_mysql_execute"><code class="option">--execute</code></a> option.
          </p></li><li class="listitem"><p>
            Statements are ignored and not logged if they match any
            pattern in the <span class="quote">“<span class="quote">ignore</span>”</span> list. This list is
            described later.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> logs each nonignored, nonempty
            statement line individually.
          </p></li><li class="listitem"><p>
            If a nonignored statement spans multiple lines (not
            including the terminating delimiter),
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> concatenates the lines to form the
            complete statement, maps newlines to spaces, and logs the
            result, plus a delimiter.
</p></li></ul>
</div>
<p>
        Consequently, an input statement that spans multiple lines can
        be logged twice. Consider this input:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT</code></strong>
    -&gt; <strong class="userinput"><code>'Today is'</code></strong>
    -&gt; <strong class="userinput"><code>,</code></strong>
    -&gt; <strong class="userinput"><code>CURDATE()</code></strong>
    -&gt; <strong class="userinput"><code>;</code></strong>
</pre><p>
        In this case, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> logs the
        <span class="quote">“<span class="quote">SELECT</span>”</span>, <span class="quote">“<span class="quote">'Today is'</span>”</span>,
        <span class="quote">“<span class="quote">,</span>”</span>, <span class="quote">“<span class="quote">CURDATE()</span>”</span>, and <span class="quote">“<span class="quote">;</span>”</span>
        lines as it reads them. It also logs the complete statement,
        after mapping <code class="literal">SELECT\n'Today
        is'\n,\nCURDATE()</code> to <code class="literal">SELECT 'Today is' ,
        CURDATE()</code>, plus a delimiter. Thus, these lines appear
        in logged output:
      </p><pre data-lang="sql" class="programlisting">SELECT
'Today is'
,
CURDATE()
;
SELECT 'Today is' , CURDATE();</pre><p>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> ignores for logging purposes statements
        that match any pattern in the <span class="quote">“<span class="quote">ignore</span>”</span> list. By
        default, the pattern list is
        <code class="literal">"*IDENTIFIED*:*PASSWORD*"</code>, to ignore
        statements that refer to passwords. Pattern matching is not
        case-sensitive. Within patterns, two characters are special:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">?</code> matches any single character.
          </p></li><li class="listitem"><p>
            <code class="literal">*</code> matches any sequence of zero or more
            characters.
</p></li></ul>
</div>
<p>
        To specify additional patterns, use the
        <a class="link" href="programs.html#option_mysql_histignore"><code class="option">--histignore</code></a> option or set the
        <code class="literal">MYSQL_HISTIGNORE</code> environment variable. (If
        both are specified, the option value takes precedence.) The
        value should be a list of one or more colon-separated patterns,
        which are appended to the default pattern list.
      </p><p>
        Patterns specified on the command line might need to be quoted
        or escaped to prevent your command interpreter from treating
        them specially. For example, to suppress logging for
        <code class="literal">UPDATE</code> and <code class="literal">DELETE</code>
        statements in addition to statements that refer to passwords,
        invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --histignore="*UPDATE*:*DELETE*"</code></strong>
</pre>
<h5><a name="mysql-logging-history-file"></a>Controlling the History File</h5>
<p>
        The <code class="filename">.mysql_history</code> file should be protected
        with a restrictive access mode because sensitive information
        might be written to it, such as the text of SQL statements that
        contain passwords. See <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
        Statements in the file are accessible from the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client when the
        <span class="keycap"><strong>up-arrow</strong></span> key is used to recall the history. See
        <a class="xref" href="programs.html#mysql-history" title="Disabling Interactive History">Disabling Interactive History</a>.
      </p><p>
        If you do not want to maintain a history file, first remove
        <code class="filename">.mysql_history</code> if it exists. Then use
        either of the following techniques to prevent it from being
        created again:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Set the <code class="literal">MYSQL_HISTFILE</code> environment
            variable to <code class="filename">/dev/null</code>. To cause this
            setting to take effect each time you log in, put it in one
            of your shell's startup files.
          </p></li><li class="listitem"><p>
            Create <code class="filename">.mysql_history</code> as a symbolic
            link to <code class="filename">/dev/null</code>; this need be done
            only once:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ln -s /dev/null $HOME/.mysql_history</code></strong>
</pre></li></ul>
</div>
<h5><a name="mysql-logging-syslog"></a>syslog Logging Characteristics</h5>
<p>
        If the <code class="option">--syslog</code> option is given,
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> writes interactive statements to the
        system logging facility. Message logging has the following
        characteristics.
      </p><p>
        Logging occurs at the <span class="quote">“<span class="quote">information</span>”</span> level. This
        corresponds to the <code class="literal">LOG_INFO</code> priority for
        <code class="literal">syslog</code> on Unix/Linux
        <code class="literal">syslog</code> capability and to
        <code class="literal">EVENTLOG_INFORMATION_TYPE</code> for the Windows
        Event Log. Consult your system documentation for configuration
        of your logging capability.
      </p><p>
        Message size is limited to 1024 bytes.
      </p><p>
        Messages consist of the identifier
        <code class="literal">MysqlClient</code> followed by these values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">SYSTEM_USER</code>
          </p><p>
            The operating system user name (login name) or
            <code class="literal">--</code> if the user is unknown.
          </p></li><li class="listitem"><p>
            <code class="literal">MYSQL_USER</code>
          </p><p>
            The MySQL user name (specified with the
            <a class="link" href="programs.html#option_mysql_user"><code class="option">--user</code></a> option) or
            <code class="literal">--</code> if the user is unknown.
          </p></li><li class="listitem"><p>
            <code class="literal">CONNECTION_ID</code>:
          </p><p>
            The client connection identifier. This is the same as the
            <a class="link" href="functions.html#function_connection-id"><code class="literal">CONNECTION_ID()</code></a> function
            value within the session.
          </p></li><li class="listitem"><p>
            <code class="literal">DB_SERVER</code>
          </p><p>
            The server host or <code class="literal">--</code> if the host is
            unknown.
          </p></li><li class="listitem"><p>
            <code class="literal">DB</code>
          </p><p>
            The default database or <code class="literal">--</code> if no database
            has been selected.
          </p></li><li class="listitem"><p>
            <code class="literal">QUERY</code>
          </p><p>
            The text of the logged statement.
</p></li></ul>
</div>
<p>
        Here is a sample of output generated on Linux by using
        <code class="option">--syslog</code>. This output is formatted for
        readability; each logged message actually takes a single line.
      </p><pre data-lang="none" class="programlisting">Mar  7 12:39:25 myhost MysqlClient[20824]:
  SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23,
  DB_SERVER:'127.0.0.1', DB:'--', QUERY:'USE test;'
Mar  7 12:39:28 myhost MysqlClient[20824]:
  SYSTEM_USER:'oscar', MYSQL_USER:'my_oscar', CONNECTION_ID:23,
DB_SERVER:'127.0.0.1', DB:'test', QUERY:'SHOW TABLES;'</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-server-side-help"></a>4.5.1.4 mysql Client Server-Side Help</h4>

</div>

</div>

</div>
<pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>help <em class="replaceable"><code>search_string</code></em></code></strong>
</pre><p>
        If you provide an argument to the <code class="literal">help</code>
        command, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> uses it as a search string to
        access server-side help from the contents of the MySQL Reference
        Manual. The proper operation of this command requires that the
        help tables in the <code class="literal">mysql</code> database be
        initialized with help topic information (see
        <a class="xref" href="server-administration.html#server-side-help-support" title="5.1.16 Server-Side Help Support">Section 5.1.16, “Server-Side Help Support”</a>).
      </p><p>
        If there is no match for the search string, the search fails:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>help me</code></strong>

Nothing found
Please try to run 'help contents' for a list of all accessible topics
</pre><p>
        Use <a class="link" href="sql-statements.html#help" title="13.8.3 HELP Statement"><span class="command"><strong>help contents</strong></span></a> to see a list of the help
        categories:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>help contents</code></strong>
You asked for help about help category: "Contents"
For more information, type 'help &lt;item&gt;', where &lt;item&gt; is one of the
following categories:
   Account Management
   Administration
   Data Definition
   Data Manipulation
   Data Types
   Functions
   Functions and Modifiers for Use with GROUP BY
   Geographic Features
   Language Structure
   Plugins
   Storage Engines
   Stored Routines
   Table Maintenance
   Transactions
   Triggers
</pre><p>
        If the search string matches multiple items,
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> shows a list of matching topics:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>help logs</code></strong>
Many help items for your request exist.
To make a more specific request, please type 'help &lt;item&gt;',
where &lt;item&gt; is one of the following topics:
   SHOW
   SHOW BINARY LOGS
   SHOW ENGINE
   SHOW LOGS
</pre><p>
        Use a topic as the search string to see the help entry for that
        topic:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>help show binary logs</code></strong>
Name: 'SHOW BINARY LOGS'
Description:
Syntax:
SHOW BINARY LOGS
SHOW MASTER LOGS

Lists the binary log files on the server. This statement is used as
part of the procedure described in [purge-binary-logs], that shows how
to determine which logs can be purged.

mysql&gt; SHOW BINARY LOGS;
+---------------+-----------+-----------+
| Log_name      | File_size | Encrypted |
+---------------+-----------+-----------+
| binlog.000015 |    724935 | Yes       |
| binlog.000016 |    733481 | Yes       |
+---------------+-----------+-----------+
</pre><p>
        The search string can contain the wildcard characters
        <code class="literal">%</code> and <code class="literal">_</code>. These have the
        same meaning as for pattern-matching operations performed with
        the <a class="link" href="functions.html#operator_like"><code class="literal">LIKE</code></a> operator. For example,
        <code class="literal">HELP rep%</code> returns a list of topics that begin
        with <code class="literal">rep</code>:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>HELP rep%</code></strong>
Many help items for your request exist.
To make a more specific request, please type 'help &lt;item&gt;',
where &lt;item&gt; is one of the following
topics:
   REPAIR TABLE
   REPEAT FUNCTION
   REPEAT LOOP
   REPLACE
   REPLACE FUNCTION
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-batch-commands"></a>4.5.1.5 Executing SQL Statements from a Text File</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444429154304"></a><a class="indexterm" name="idm46444429153232"></a><a class="indexterm" name="idm46444429151744"></a><a class="indexterm" name="idm46444429150256"></a><a class="indexterm" name="idm46444429148768"></a><a class="indexterm" name="idm46444429147280"></a><a class="indexterm" name="idm46444429146192"></a><a class="indexterm" name="idm46444429145104"></a><a class="indexterm" name="idm46444429144000"></a><p>
        The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client typically is used
        interactively, like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql <em class="replaceable"><code>db_name</code></em></code></strong>
</pre><p>
        However, it is also possible to put your SQL statements in a
        file and then tell <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to read its input
        from that file. To do so, create a text file
        <em class="replaceable"><code>text_file</code></em> that contains the
        statements you wish to execute. Then invoke
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> as shown here:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql <em class="replaceable"><code>db_name</code></em> &lt; <em class="replaceable"><code>text_file</code></em></code></strong>
</pre><p>
        If you place a <code class="literal">USE
        <em class="replaceable"><code>db_name</code></em></code> statement as the
        first statement in the file, it is unnecessary to specify the
        database name on the command line:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql &lt; text_file</code></strong>
</pre><p>
        If you are already running <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>, you can
        execute an SQL script file using the <code class="literal">source</code>
        command or <code class="literal">\.</code> command:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>source <em class="replaceable"><code>file_name</code></em></code></strong>
mysql&gt; <strong class="userinput"><code>\. <em class="replaceable"><code>file_name</code></em></code></strong>
</pre><p>
        Sometimes you may want your script to display progress
        information to the user. For this you can insert statements like
        this:
      </p><pre data-lang="sql" class="programlisting">SELECT '&lt;info_to_display&gt;' AS ' ';</pre><p>
        The statement shown outputs
        <code class="literal">&lt;info_to_display&gt;</code>.
      </p><p>
        You can also invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> with the
        <a class="link" href="programs.html#option_mysql_verbose"><code class="option">--verbose</code></a> option, which causes
        each statement to be displayed before the result that it
        produces.
      </p><p>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> ignores Unicode byte order mark (BOM)
        characters at the beginning of input files. Previously, it read
        them and sent them to the server, resulting in a syntax error.
        Presence of a BOM does not cause <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to
        change its default character set. To do that, invoke
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> with an option such as
        <a class="link" href="programs.html#option_mysql_default-character-set"><code class="option">--default-character-set=utf8</code></a>.
      </p><p>
        For more information about batch mode, see
        <a class="xref" href="tutorial.html#batch-mode" title="3.5 Using mysql in Batch Mode">Section 3.5, “Using mysql in Batch Mode”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysql-tips"></a>4.5.1.6 mysql Client Tips</h4>

</div>

</div>

</div>
<p>
        This section provides information about techniques for more
        effective use of <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> and about
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> operational behavior.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#mysql-input-editing" title="Input-Line Editing">Input-Line Editing</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysql-history" title="Disabling Interactive History">Disabling Interactive History</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#windows-unicode-support" title="Unicode Support on Windows">Unicode Support on Windows</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#vertical-query-results" title="Displaying Query Results Vertically">Displaying Query Results Vertically</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#safe-updates" title="Using Safe-Updates Mode (--safe-updates)">Using Safe-Updates Mode (--safe-updates)</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysql-reconnect" title="Disabling mysql Auto-Reconnect">Disabling mysql Auto-Reconnect</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysql-parsers" title="mysql Client Parser Versus Server Parser">mysql Client Parser Versus Server Parser</a></p></li></ul>
</div>
<h5><a name="mysql-input-editing"></a>Input-Line Editing</h5>
<p>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> supports input-line editing, which
        enables you to modify the current input line in place or recall
        previous input lines. For example, the
        <span class="keycap"><strong>left-arrow</strong></span> and <span class="keycap"><strong>right-arrow</strong></span>
        keys move horizontally within the current input line, and the
        <span class="keycap"><strong>up-arrow</strong></span> and <span class="keycap"><strong>down-arrow</strong></span> keys
        move up and down through the set of previously entered lines.
        <span class="keycap"><strong>Backspace</strong></span> deletes the character before the
        cursor and typing new characters enters them at the cursor
        position. To enter the line, press <span class="keycap"><strong>Enter</strong></span>.
      </p><p>
        On Windows, the editing key sequences are the same as supported
        for command editing in console windows. On Unix, the key
        sequences depend on the input library used to build
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> (for example, the
        <code class="literal">libedit</code> or <code class="literal">readline</code>
        library).
      </p><p>
        Documentation for the <code class="literal">libedit</code> and
        <code class="literal">readline</code> libraries is available online. To
        change the set of key sequences permitted by a given input
        library, define key bindings in the library startup file. This
        is a file in your home directory: <code class="filename">.editrc</code>
        for <code class="literal">libedit</code> and <code class="filename">.inputrc</code>
        for <code class="literal">readline</code>.
      </p><p>
        For example, in <code class="literal">libedit</code>,
        <span class="keycap"><strong>Control+W</strong></span> deletes everything before the current
        cursor position and <span class="keycap"><strong>Control+U</strong></span> deletes the
        entire line. In <code class="literal">readline</code>,
        <span class="keycap"><strong>Control+W</strong></span> deletes the word before the cursor
        and <span class="keycap"><strong>Control+U</strong></span> deletes everything before the
        current cursor position. If <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> was built
        using <code class="literal">libedit</code>, a user who prefers the
        <code class="literal">readline</code> behavior for these two keys can put
        the following lines in the <code class="filename">.editrc</code> file
        (creating the file if necessary):
      </p><pre data-lang="terminal" class="programlisting">bind "^W" ed-delete-prev-word
bind "^U" vi-kill-line-prev</pre><p>
        To see the current set of key bindings, temporarily put a line
        that says only <code class="literal">bind</code> at the end of
        <code class="filename">.editrc</code>. <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> will show
        the bindings when it starts.
</p>
<h5><a name="mysql-history"></a>Disabling Interactive History</h5>
<a class="indexterm" name="idm46444429071248"></a><p>
        The <span class="keycap"><strong>up-arrow</strong></span> key enables you to recall input
        lines from current and previous sessions. In cases where a
        console is shared, this behavior may be unsuitable.
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> supports disabling the interactive
        history partially or fully, depending on the host platform.
      </p><p>
        On Windows, the history is stored in memory.
        <span class="keycap"><strong>Alt+F7</strong></span> deletes all input lines stored in memory
        for the current history buffer. It also deletes the list of
        sequential numbers in front of the input lines displayed with
        <span class="keycap"><strong>F7</strong></span> and recalled (by number) with
        <span class="keycap"><strong>F9</strong></span>. New input lines entered after you press
        <span class="keycap"><strong>Alt+F7</strong></span> repopulate the current history buffer.
        Clearing the buffer does not prevent logging to the Windows
        Event Viewer, if the <a class="link" href="programs.html#option_mysql_syslog"><code class="option">--syslog</code></a>
        option was used to start <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>. Closing the
        console window also clears the current history buffer.
      </p><p>
        To disable interactive history on Unix, first delete the
        <code class="filename">.mysql_history</code> file, if it exists (previous
        entries are recalled otherwise). Then start
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> with the
        <code class="literal">--histignore="*"</code> option to ignore all new
        input lines. To re-enable the recall (and logging) behavior,
        restart <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> without the option.
      </p><p>
        If you prevent the <code class="filename">.mysql_history</code> file from
        being created (see <a class="xref" href="programs.html#mysql-logging-history-file" title="Controlling the History File">Controlling the History File</a>)
        and use <code class="literal">--histignore="*"</code> to start the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client, the interactive history recall
        facility is disabled fully. Alternatively, if you omit the
        <a class="link" href="programs.html#option_mysql_histignore"><code class="option">--histignore</code></a> option, you can
        recall the input lines entered during the current session.
</p>
<h5><a name="windows-unicode-support"></a>Unicode Support on Windows</h5>
<p>
        Windows provides APIs based on UTF-16LE for reading from and
        writing to the console; the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client for
        Windows is able to use these APIs. The Windows installer creates
        an item in the MySQL menu named <code class="literal">MySQL command line
        client - Unicode</code>. This item invokes the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client with properties set to
        communicate through the console to the MySQL server using
        Unicode.
      </p><p>
        To take advantage of this support manually, run
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> within a console that uses a compatible
        Unicode font and set the default character set to a Unicode
        character set that is supported for communication with the
        server:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Open a console window.
          </p></li><li class="listitem"><p>
            Go to the console window properties, select the font tab,
            and choose Lucida Console or some other compatible Unicode
            font. This is necessary because console windows start by
            default using a DOS raster font that is inadequate for
            Unicode.
          </p></li><li class="listitem"><p>
            Execute <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql.exe</strong></span></a> with the
            <a class="link" href="programs.html#option_mysql_default-character-set"><code class="option">--default-character-set=utf8</code></a>
            (or <code class="literal">utf8mb4</code>) option. This option is
            necessary because <code class="literal">utf16le</code> is one of the
            character sets that cannot be used as the client character
            set. See
            <a class="xref" href="charset.html#charset-connection-impermissible-client-charset" title="Impermissible Client Character Sets">Impermissible Client Character Sets</a>.
</p></li></ol>
</div>
<p>
        With those changes, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> will use the
        Windows APIs to communicate with the console using UTF-16LE, and
        communicate with the server using UTF-8. (The menu item
        mentioned previously sets the font and character set as just
        described.)
      </p><p>
        To avoid those steps each time you run <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>,
        you can create a shortcut that invokes
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql.exe</strong></span></a>. The shortcut should set the
        console font to Lucida Console or some other compatible Unicode
        font, and pass the
        <a class="link" href="programs.html#option_mysql_default-character-set"><code class="option">--default-character-set=utf8</code></a> (or
        <code class="literal">utf8mb4</code>) option to
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql.exe</strong></span></a>.
      </p><p>
        Alternatively, create a shortcut that only sets the console
        font, and set the character set in the
        <code class="literal">[mysql]</code> group of your
        <code class="filename">my.ini</code> file:
      </p><pre data-lang="ini" class="programlisting">[mysql]
default-character-set=utf8</pre>
<h5><a name="vertical-query-results"></a>Displaying Query Results Vertically</h5>
<p>
        Some query results are much more readable when displayed
        vertically, instead of in the usual horizontal table format.
        Queries can be displayed vertically by terminating the query
        with \G instead of a semicolon. For example, longer text values
        that include newlines often are much easier to read with
        vertical output:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>SELECT * FROM mails WHERE LENGTH(txt) &lt; 300 LIMIT 300,1\G</code></strong>
*************************** 1. row ***************************
  msg_nro: 3068
     date: 2000-03-01 23:29:50
time_zone: +0200
mail_from: Jones
    reply: jones@example.com
  mail_to: "John Smith" &lt;smith@example.com&gt;
      sbj: UTF-8
      txt: &gt;&gt;&gt;&gt;&gt; "John" == John Smith writes:

John&gt; Hi.  I think this is a good idea.  Is anyone familiar
John&gt; with UTF-8 or Unicode? Otherwise, I'll put this on my
John&gt; TODO list and see what happens.

Yes, please do that.

Regards,
Jones
     file: inbox-jani-1
     hash: 190402944
1 row in set (0.09 sec)
</pre>
<h5><a name="safe-updates"></a>Using Safe-Updates Mode (--safe-updates)</h5>
<a class="indexterm" name="idm46444429019792"></a><a class="indexterm" name="idm46444429018752"></a><a class="indexterm" name="idm46444429017264"></a><a class="indexterm" name="idm46444429016176"></a><a class="indexterm" name="idm46444429014688"></a><a class="indexterm" name="idm46444429013600"></a><a class="indexterm" name="idm46444429012112"></a><a class="indexterm" name="idm46444429011024"></a><p>
        For beginners, a useful startup option is
        <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a> (or
        <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--i-am-a-dummy</code></a>,
        which has the same effect). Safe-updates mode is helpful for
        cases when you might have issued an
        <a class="link" href="sql-statements.html#update" title="13.2.13 UPDATE Statement"><code class="literal">UPDATE</code></a> or
        <a class="link" href="sql-statements.html#delete" title="13.2.2 DELETE Statement"><code class="literal">DELETE</code></a> statement but forgotten
        the <code class="literal">WHERE</code> clause indicating which rows to
        modify. Normally, such statements update or delete all rows in
        the table. With <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a>,
        you can modify rows only by specifying the key values that
        identify them, or a <code class="literal">LIMIT</code> clause, or both.
        This helps prevent accidents. Safe-updates mode also restricts
        <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> statements that produce
        (or are estimated to produce) very large result sets.
      </p><p>
        The <a class="link" href="programs.html#option_mysql_safe-updates"><code class="option">--safe-updates</code></a> option causes
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> to execute the following statement when
        it connects to the MySQL server, to set the session values of
        the <a class="link" href="server-administration.html#sysvar_sql_safe_updates"><code class="literal">sql_safe_updates</code></a>,
        <a class="link" href="server-administration.html#sysvar_sql_select_limit"><code class="literal">sql_select_limit</code></a>, and
        <a class="link" href="server-administration.html#sysvar_max_join_size"><code class="literal">max_join_size</code></a> system variables:
      </p><pre data-lang="sql" class="programlisting">SET sql_safe_updates=1, sql_select_limit=1000, max_join_size=1000000;</pre><p>
        The <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET</code></a>
        statement affects statement processing as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Enabling <a class="link" href="server-administration.html#sysvar_sql_safe_updates"><code class="literal">sql_safe_updates</code></a>
            causes <a class="link" href="sql-statements.html#update" title="13.2.13 UPDATE Statement"><code class="literal">UPDATE</code></a> and
            <a class="link" href="sql-statements.html#delete" title="13.2.2 DELETE Statement"><code class="literal">DELETE</code></a> statements to produce
            an error if they do not specify a key constraint in the
            <code class="literal">WHERE</code> clause, or provide a
            <code class="literal">LIMIT</code> clause, or both. For example:
          </p><pre data-lang="sql" class="programlisting">UPDATE <em class="replaceable"><code>tbl_name</code></em> SET <em class="replaceable"><code>not_key_column</code></em>=<em class="replaceable"><code>val</code></em> WHERE <em class="replaceable"><code>key_column</code></em>=<em class="replaceable"><code>val</code></em>;

UPDATE <em class="replaceable"><code>tbl_name</code></em> SET <em class="replaceable"><code>not_key_column</code></em>=<em class="replaceable"><code>val</code></em> LIMIT 1;
</pre></li><li class="listitem"><p>
            Setting <a class="link" href="server-administration.html#sysvar_sql_select_limit"><code class="literal">sql_select_limit</code></a> to
            1,000 causes the server to limit all
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> result sets to 1,000
            rows unless the statement includes a
            <code class="literal">LIMIT</code> clause.
          </p></li><li class="listitem"><p>
            Setting <a class="link" href="server-administration.html#sysvar_max_join_size"><code class="literal">max_join_size</code></a> to
            1,000,000 causes multiple-table
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> statements to produce
            an error if the server estimates it must examine more than
            1,000,000 row combinations.
</p></li></ul>
</div>
<p>
        To specify result set limits different from 1,000 and 1,000,000,
        you can override the defaults by using the
        <a class="link" href="programs.html#option_mysql_select-limit"><code class="option">--select-limit</code></a> and
        <a class="link" href="programs.html#option_mysql_max-join-size"><code class="option">--max-join-size</code></a> options when you
        invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>:
      </p><pre data-lang="terminal" class="programlisting">mysql --safe-updates --select-limit=500 --max-join-size=10000</pre><p>
        It is possible for <a class="link" href="sql-statements.html#update" title="13.2.13 UPDATE Statement"><code class="literal">UPDATE</code></a> and
        <a class="link" href="sql-statements.html#delete" title="13.2.2 DELETE Statement"><code class="literal">DELETE</code></a> statements to produce an
        error in safe-updates mode even with a key specified in the
        <code class="literal">WHERE</code> clause, if the optimizer decides not to
        use the index on the key column:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Range access on the index cannot be used if memory usage
            exceeds that permitted by the
            <a class="link" href="server-administration.html#sysvar_range_optimizer_max_mem_size"><code class="literal">range_optimizer_max_mem_size</code></a>
            system variable. The optimizer then falls back to a table
            scan. See <a class="xref" href="optimization.html#range-optimization-memory-use" title="Limiting Memory Use for Range Optimization">Limiting Memory Use for Range Optimization</a>.
          </p></li><li class="listitem"><p>
            If key comparisons require type conversion, the index may
            not be used (see <a class="xref" href="optimization.html#mysql-indexes" title="8.3.1 How MySQL Uses Indexes">Section 8.3.1, “How MySQL Uses Indexes”</a>). Suppose
            that an indexed string column <code class="literal">c1</code> is
            compared to a numeric value using <code class="literal">WHERE c1 =
            2222</code>. For such comparisons, the string value is
            converted to a number and the operands are compared
            numerically (see <a class="xref" href="functions.html#type-conversion" title="12.2 Type Conversion in Expression Evaluation">Section 12.2, “Type Conversion in Expression Evaluation”</a>),
            preventing use of the index. If safe-updates mode is
            enabled, an error occurs.
</p></li></ul>
</div>
<p>
        As of MySQL 8.0.13, safe-updates mode also includes these
        behaviors:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="sql-statements.html#explain" title="13.8.2 EXPLAIN Statement"><code class="literal">EXPLAIN</code></a> with
            <a class="link" href="sql-statements.html#update" title="13.2.13 UPDATE Statement"><code class="literal">UPDATE</code></a> and
            <a class="link" href="sql-statements.html#delete" title="13.2.2 DELETE Statement"><code class="literal">DELETE</code></a> statements does not
            produce safe-updates errors. This enables use of
            <a class="link" href="sql-statements.html#explain" title="13.8.2 EXPLAIN Statement"><code class="literal">EXPLAIN</code></a> plus
            <a class="link" href="sql-statements.html#show-warnings" title="13.7.7.40 SHOW WARNINGS Statement"><code class="literal">SHOW WARNINGS</code></a> to see why an
            index is not used, which can be helpful in cases such as
            when a
            <a class="link" href="server-administration.html#sysvar_range_optimizer_max_mem_size"><code class="literal">range_optimizer_max_mem_size</code></a>
            violation or type conversion occurs and the optimizer does
            not use an index even though a key column was specified in
            the <code class="literal">WHERE</code> clause.
          </p></li><li class="listitem"><p>
            When a safe-updates error occurs, the error message includes
            the first diagnostic that was produced, to provide
            information about the reason for failure. For example, the
            message may indicate that the
            <a class="link" href="server-administration.html#sysvar_range_optimizer_max_mem_size"><code class="literal">range_optimizer_max_mem_size</code></a>
            value was exceeded or type conversion occurred, either of
            which can preclude use of an index.
          </p></li><li class="listitem"><p>
            For multiple-table deletes and updates, an error is produced
            with safe updates enabled only if any target table uses a
            table scan.
</p></li></ul>
</div>
<h5><a name="mysql-reconnect"></a>Disabling mysql Auto-Reconnect</h5>
<p>
        If the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client loses its connection to
        the server while sending a statement, it immediately and
        automatically tries to reconnect once to the server and send the
        statement again. However, even if <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
        succeeds in reconnecting, your first connection has ended and
        all your previous session objects and settings are lost:
        temporary tables, the autocommit mode, and user-defined and
        session variables. Also, any current transaction rolls back.
        This behavior may be dangerous for you, as in the following
        example where the server was shut down and restarted between the
        first and second statements without you knowing it:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>SET @a=1;</code></strong>
Query OK, 0 rows affected (0.05 sec)

mysql&gt; <strong class="userinput"><code>INSERT INTO t VALUES(@a);</code></strong>
ERROR 2006: MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: test

Query OK, 1 row affected (1.30 sec)

mysql&gt; <strong class="userinput"><code>SELECT * FROM t;</code></strong>
+------+
| a    |
+------+
| NULL |
+------+
1 row in set (0.05 sec)
</pre><p>
        The <code class="literal">@a</code> user variable has been lost with the
        connection, and after the reconnection it is undefined. If it is
        important to have <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> terminate with an
        error if the connection has been lost, you can start the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client with the
        <a class="link" href="programs.html#option_mysql_reconnect"><code class="option">--skip-reconnect</code></a>
        option.
      </p><p>
        For more information about auto-reconnect and its effect on
        state information when a reconnection occurs, see
        <a class="xref" href="connectors-apis.html#c-api-auto-reconnect" title="28.7.27 C API Automatic Reconnection Control">Section 28.7.27, “C API Automatic Reconnection Control”</a>.
</p>
<h5><a name="mysql-parsers"></a>mysql Client Parser Versus Server Parser</h5>
<a class="indexterm" name="idm46444428927440"></a><a class="indexterm" name="idm46444428925984"></a><p>
        The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client uses a parser on the client
        side that is not a duplicate of the complete parser used by the
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server on the server side. This can
        lead to differences in treatment of certain constructs.
        Examples:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The server parser treats strings delimited by
            <code class="literal">"</code> characters as identifiers rather than
            as plain strings if the
            <a class="link" href="server-administration.html#sqlmode_ansi_quotes"><code class="literal">ANSI_QUOTES</code></a> SQL mode is
            enabled.
          </p><p>
            The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client parser does not take the
            <code class="literal">ANSI_QUOTES</code> SQL mode into account. It
            treats strings delimited by <code class="literal">"</code>,
            <code class="literal">'</code>, and <code class="literal">`</code> characters
            the same, regardless of whether
            <a class="link" href="server-administration.html#sqlmode_ansi_quotes"><code class="literal">ANSI_QUOTES</code></a> is enabled.
          </p></li><li class="listitem"><p>
            Within <code class="literal">/*! ... */</code> and <code class="literal">/*+ ...
            */</code> comments, the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client
            parser interprets short-form <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
            commands. The server parser does not interpret them because
            these commands have no meaning on the server side.
          </p><p>
            If it is desirable for <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> not to
            interpret short-form commands within comments, a partial
            workaround is to use the
            <a class="link" href="programs.html#option_mysql_binary-mode"><code class="option">--binary-mode</code></a> option, which
            causes all <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> commands to be disabled
            except <code class="literal">\C</code> and <code class="literal">\d</code> in
            noninteractive mode (for input piped to
            <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> or loaded using the
            <code class="literal">source</code> command).
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqladmin"></a>4.5.2 <span class="command"><strong>mysqladmin</strong></span> — Client for Administering a MySQL Server</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444428898304"></a><a class="indexterm" name="idm46444428897360"></a><a class="indexterm" name="idm46444428896000"></a><p>
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> is a client for performing
        administrative operations. You can use it to check the server's
        configuration and current status, to create and drop databases,
        and more.
      </p><p>
        Invoke <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>command</code></em> [<em class="replaceable"><code>command-arg</code></em>] [<em class="replaceable"><code>command</code></em> [<em class="replaceable"><code>command-arg</code></em>]] ...</code></strong>
</pre><p>
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> supports the following commands.
        Some of the commands take an argument following the command
        name.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="command_mysqladmin_db_name"></a>
            <code class="literal">create <em class="replaceable"><code>db_name</code></em></code>
          </p><p>
            Create a new database named
            <em class="replaceable"><code>db_name</code></em>.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_debug"></a>
            <code class="literal">debug</code>
          </p><p>
            Tell the server to write debug information to the error log.
            The connected user must have the
            <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege. Format and
            content of this information is subject to change.
          </p><p>
            This includes information about the Event Scheduler. See
            <a class="xref" href="stored-objects.html#events-status-info" title="24.4.5 Event Scheduler Status">Section 24.4.5, “Event Scheduler Status”</a>.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_drop"></a>
            <code class="literal">drop <em class="replaceable"><code>db_name</code></em></code>
          </p><p>
            Delete the database named <em class="replaceable"><code>db_name</code></em>
            and all its tables.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_extended-status"></a>
            <code class="literal">extended-status</code>
          </p><p>
            Display the server status variables and their values.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_flush-hosts"></a>
            <code class="literal">flush-hosts</code>
          </p><p>
            Flush all information in the host cache. See
            <a class="xref" href="server-administration.html#host-cache" title="5.1.12.3 DNS Lookups and the Host Cache">Section 5.1.12.3, “DNS Lookups and the Host Cache”</a>.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_flush-logs"></a>
            <code class="literal">flush-logs [<em class="replaceable"><code>log_type</code></em>
            ...]</code>
          </p><p>
            Flush all logs.
          </p><p>
            The <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin flush-logs</strong></span></a> command permits
            optional log types to be given, to specify which logs to
            flush. Following the <code class="literal">flush-logs</code> command,
            you can provide a space-separated list of one or more of the
            following log types: <code class="literal">binary</code>,
            <code class="literal">engine</code>, <code class="literal">error</code>,
            <code class="literal">general</code>, <code class="literal">relay</code>,
            <code class="literal">slow</code>. These correspond to the log types
            that can be specified for the <a class="link" href="sql-statements.html#flush-logs"><code class="literal">FLUSH
            LOGS</code></a> SQL statement.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_flush-privileges"></a>
            <code class="literal">flush-privileges</code>
          </p><p>
            Reload the grant tables (same as <code class="literal">reload</code>).
          </p></li><li class="listitem"><p><a name="command_mysqladmin_flush-status"></a>
            <code class="literal">flush-status</code>
          </p><p>
            Clear status variables.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_flush-tables"></a>
            <code class="literal">flush-tables</code>
          </p><p>
            Flush all tables.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_flush-threads"></a>
            <code class="literal">flush-threads</code>
          </p><p>
            Flush the thread cache.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_kill"></a>
            <code class="literal">kill
            <em class="replaceable"><code>id</code></em>,<em class="replaceable"><code>id</code></em>,...</code>
          </p><p>
            Kill server threads. If multiple thread ID values are given,
            there must be no spaces in the list.
          </p><p>
            To kill threads belonging to other users, the connected user
            must have the
            <a class="link" href="security.html#priv_connection-admin"><code class="literal">CONNECTION_ADMIN</code></a> privilege
            (or the deprecated <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a>
            privilege).
          </p></li><li class="listitem"><p><a name="command_mysqladmin_password"></a>
            <code class="literal">password
            <em class="replaceable"><code>new_password</code></em></code>
          </p><p>
            Set a new password. This changes the password to
            <em class="replaceable"><code>new_password</code></em> for the account that
            you use with <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> for connecting to
            the server. Thus, the next time you invoke
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> (or any other client program)
            using the same account, you will need to specify the new
            password.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
              Setting a password using <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>
              should be considered <span class="emphasis"><em>insecure</em></span>. On
              some systems, your password becomes visible to system
              status programs such as <span class="command"><strong>ps</strong></span> that may be
              invoked by other users to display command lines. MySQL
              clients typically overwrite the command-line password
              argument with zeros during their initialization sequence.
              However, there is still a brief interval during which the
              value is visible. Also, on some systems this overwriting
              strategy is ineffective and the password remains visible
              to <span class="command"><strong>ps</strong></span>. (SystemV Unix systems and
              perhaps others are subject to this problem.)
</p>
</div>
<p>
            If the <em class="replaceable"><code>new_password</code></em> value
            contains spaces or other characters that are special to your
            command interpreter, you need to enclose it within quotation
            marks. On Windows, be sure to use double quotation marks
            rather than single quotation marks; single quotation marks
            are not stripped from the password, but rather are
            interpreted as part of the password. For example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin password "my new password"</code></strong>
</pre><p>
            The new password can be omitted following the
            <code class="literal">password</code> command. In this case,
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> prompts for the password
            value, which enables you to avoid specifying the password on
            the command line. Omitting the password value should be done
            only if <code class="literal">password</code> is the final command on
            the <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> command line. Otherwise,
            the next argument is taken as the password.
</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Caution
</div>
<p>
              Do not use this command used if the server was started
              with the
              <a class="link" href="server-administration.html#option_mysqld_skip-grant-tables"><code class="option">--skip-grant-tables</code></a> option.
              No password change will be applied. This is true even if
              you precede the <code class="literal">password</code> command with
              <code class="literal">flush-privileges</code> on the same command
              line to re-enable the grant tables because the flush
              operation occurs after you connect. However, you can use
              <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin flush-privileges</strong></span></a> to
              re-enable the grant table and then use a separate
              <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin password</strong></span></a> command to change
              the password.
</p>
</div>
</li><li class="listitem"><p><a name="command_mysqladmin_ping"></a>
            <code class="literal">ping</code>
          </p><p>
            Check whether the server is available. The return status
            from <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> is 0 if the server is
            running, 1 if it is not. This is 0 even in case of an error
            such as <code class="literal">Access denied</code>, because this means
            that the server is running but refused the connection, which
            is different from the server not running.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_processlist"></a>
            <code class="literal">processlist</code>
          </p><p>
            Show a list of active server threads. This is like the
            output of the <a class="link" href="sql-statements.html#show-processlist" title="13.7.7.29 SHOW PROCESSLIST Statement"><code class="literal">SHOW
            PROCESSLIST</code></a> statement. If the
            <a class="link" href="programs.html#option_mysqladmin_verbose"><code class="option">--verbose</code></a> option is
            given, the output is like that of
            <a class="link" href="sql-statements.html#show-processlist" title="13.7.7.29 SHOW PROCESSLIST Statement"><code class="literal">SHOW FULL
            PROCESSLIST</code></a>. (See
            <a class="xref" href="sql-statements.html#show-processlist" title="13.7.7.29 SHOW PROCESSLIST Statement">Section 13.7.7.29, “SHOW PROCESSLIST Statement”</a>.)
          </p></li><li class="listitem"><p><a name="command_mysqladmin_reload"></a>
            <code class="literal">reload</code>
          </p><p>
            Reload the grant tables.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_refresh"></a>
            <code class="literal">refresh</code>
          </p><p>
            Flush all tables and close and open log files.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_shutdown"></a>
            <code class="literal">shutdown</code>
          </p><p>
            Stop the server.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_start-slave"></a>
            <code class="literal">start-slave</code>
          </p><p>
            Start replication on a slave server.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_status"></a>
            <code class="literal">status</code>
          </p><p>
            Display a short server status message.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_stop-slave"></a>
            <code class="literal">stop-slave</code>
          </p><p>
            Stop replication on a slave server.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_variables"></a>
            <code class="literal">variables</code>
          </p><p>
            Display the server system variables and their values.
          </p></li><li class="listitem"><p><a name="command_mysqladmin_version"></a>
            <code class="literal">version</code>
          </p><p>
            Display version information from the server.
</p></li></ul>
</div>
<p>
        All commands can be shortened to any unique prefix. For example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqladmin proc stat</code></strong>
+----+-------+-----------+----+---------+------+-------+------------------+
| Id | User  | Host      | db | Command | Time | State | Info             |
+----+-------+-----------+----+---------+------+-------+------------------+
| 51 | jones | localhost |    | Query   | 0    |       | show processlist |
+----+-------+-----------+----+---------+------+-------+------------------+
Uptime: 1473624  Threads: 1  Questions: 39487
Slow queries: 0  Opens: 541  Flush tables: 1
Open tables: 19  Queries per second avg: 0.0268
</pre><a class="indexterm" name="idm46444428782064"></a><p>
        The <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin status</strong></span></a> command result displays
        the following values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="indexterm" name="idm46444428778160"></a>

            <a class="link" href="server-administration.html#statvar_Uptime"><code class="literal">Uptime</code></a>
          </p><p>
            The number of seconds the MySQL server has been running.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444428774576"></a>

            <code class="literal">Threads</code>
          </p><p>
            The number of active threads (clients).
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444428771584"></a>

            <a class="link" href="server-administration.html#statvar_Questions"><code class="literal">Questions</code></a>
          </p><p>
            The number of questions (queries) from clients since the
            server was started.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444428767856"></a>

            <code class="literal">Slow queries</code>
          </p><p>
            The number of queries that have taken more than
            <a class="link" href="server-administration.html#sysvar_long_query_time"><code class="literal">long_query_time</code></a> seconds.
            See <a class="xref" href="server-administration.html#slow-query-log" title="5.4.5 The Slow Query Log">Section 5.4.5, “The Slow Query Log”</a>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444428762752"></a>

            <code class="literal">Opens</code>
          </p><p>
            The number of tables the server has opened.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444428759760"></a>

            <a class="indexterm" name="idm46444428758688"></a>

            <code class="literal">Flush tables</code>
          </p><p>
            The number of <code class="literal">flush-*</code>,
            <code class="literal">refresh</code>, and <code class="literal">reload</code>
            commands the server has executed.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444428753104"></a>

            <code class="literal">Open tables</code>
          </p><p>
            The number of tables that currently are open.
</p></li></ul>
</div>
<p>
        If you execute <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin shutdown</strong></span></a> when
        connecting to a local server using a Unix socket file,
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> waits until the server's process
        ID file has been removed, to ensure that the server has stopped
        properly.
      </p><a class="indexterm" name="idm46444428747424"></a><a class="indexterm" name="idm46444428746336"></a><a class="indexterm" name="idm46444428744848"></a><a class="indexterm" name="idm46444428742944"></a><p>
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqladmin]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444428737552"></a><p class="title"><b>Table 4.12 mysqladmin Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqladmin."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_connect_timeout">--connect_timeout</a></td>
<td>Number of seconds before connection timeout</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_count">--count</a></td>
<td>Number of iterations to make for repeated command execution</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_force">--force</a></td>
<td>Continue even if an SQL error occurs</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_no-beep">--no-beep</a></td>
<td>Do not beep when errors occur</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_relative">--relative</a></td>
<td>Show the difference between the current and previous values when used with the --sleep option</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_show-warnings">--show-warnings</a></td>
<td>Show warnings after statement execution</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_shutdown_timeout">--shutdown_timeout</a></td>
<td>The maximum number of seconds to wait for server shutdown</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_silent">--silent</a></td>
<td>Silent mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_sleep">--sleep</a></td>
<td>Execute commands repeatedly, sleeping for delay seconds in between</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_vertical">--vertical</a></td>
<td>Print query output rows vertically (one line per column value)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_wait">--wait</a></td>
<td>If the connection cannot be established, wait and retry instead of aborting</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqladmin_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqladmin_help"></a>
            <a class="indexterm" name="idm46444428494080"></a>

            <a class="indexterm" name="idm46444428492624"></a>

            <a class="link" href="programs.html#option_mysqladmin_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_bind-address"></a>
            <a class="indexterm" name="idm46444428488048"></a>

            <a class="indexterm" name="idm46444428486560"></a>

            <a class="link" href="programs.html#option_mysqladmin_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_character-sets-dir"></a>
            <a class="indexterm" name="idm46444428482016"></a>

            <a class="indexterm" name="idm46444428480560"></a>

            <a class="link" href="programs.html#option_mysqladmin_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_compress"></a>
            <a class="indexterm" name="idm46444428475376"></a>

            <a class="indexterm" name="idm46444428473888"></a>

            <a class="link" href="programs.html#option_mysqladmin_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqladmin_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444428465840"></a><a class="indexterm" name="idm46444428464336"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_count"></a>
            <a class="indexterm" name="idm46444428457520"></a>

            <a class="indexterm" name="idm46444428456064"></a>

            <a class="link" href="programs.html#option_mysqladmin_count"><code class="option">--count=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-c <em class="replaceable"><code>N</code></em></code>
          </p><p>
            The number of iterations to make for repeated command
            execution if the <a class="link" href="programs.html#option_mysqladmin_sleep"><code class="option">--sleep</code></a>
            option is given.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_debug"></a>
            <a class="indexterm" name="idm46444428450048"></a>

            <a class="indexterm" name="idm46444428448592"></a>

            <a class="link" href="programs.html#option_mysqladmin_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:o,/tmp/mysqladmin.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_debug-check"></a>
            <a class="indexterm" name="idm46444428438992"></a>

            <a class="indexterm" name="idm46444428437504"></a>

            <a class="link" href="programs.html#option_mysqladmin_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_debug-info"></a>
            <a class="indexterm" name="idm46444428431408"></a>

            <a class="indexterm" name="idm46444428429920"></a>

            <a class="link" href="programs.html#option_mysqladmin_debug-info"><code class="option">--debug-info</code></a>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_default-auth"></a>
            <a class="indexterm" name="idm46444428423776"></a>

            <a class="indexterm" name="idm46444428422288"></a>

            <a class="link" href="programs.html#option_mysqladmin_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_default-character-set"></a>
            <a class="indexterm" name="idm46444428417120"></a>

            <a class="indexterm" name="idm46444428415664"></a>

            <a class="link" href="programs.html#option_mysqladmin_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444428410048"></a>

            <a class="indexterm" name="idm46444428408592"></a>

            <a class="link" href="programs.html#option_mysqladmin_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_defaults-file"></a>
            <a class="indexterm" name="idm46444428402192"></a>

            <a class="indexterm" name="idm46444428400704"></a>

            <a class="link" href="programs.html#option_mysqladmin_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444428392272"></a>

            <a class="indexterm" name="idm46444428390816"></a>

            <a class="link" href="programs.html#option_mysqladmin_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqladmin]</code> groups. If the
            <a class="link" href="programs.html#option_mysqladmin_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> also reads
            the <code class="literal">[client_other]</code> and
            <code class="literal">[mysqladmin_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444428378208"></a>

            <a class="indexterm" name="idm46444428376704"></a>

            <a class="link" href="programs.html#option_mysqladmin_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysqladmin_force"></a>
            <a class="indexterm" name="idm46444428371072"></a>

            <a class="indexterm" name="idm46444428369616"></a>

            <a class="link" href="programs.html#option_mysqladmin_force"><code class="option">--force</code></a>,
            <code class="option">-f</code>
          </p><p>
            Do not ask for confirmation for the <code class="literal">drop
            <em class="replaceable"><code>db_name</code></em></code> command. With
            multiple commands, continue even if an error occurs.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_get-server-public-key"></a>
            <a class="indexterm" name="idm46444428364016"></a>

            <a class="indexterm" name="idm46444428362560"></a>

            <a class="link" href="programs.html#option_mysqladmin_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqladmin_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqladmin_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_host"></a>
            <a class="indexterm" name="idm46444428351968"></a>

            <a class="indexterm" name="idm46444428350512"></a>

            <a class="link" href="programs.html#option_mysqladmin_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_login-path"></a>
            <a class="indexterm" name="idm46444428345472"></a>

            <a class="indexterm" name="idm46444428343984"></a>

            <a class="link" href="programs.html#option_mysqladmin_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_no-beep"></a>
            <a class="indexterm" name="idm46444428335072"></a>

            <a class="indexterm" name="idm46444428333584"></a>

            <a class="link" href="programs.html#option_mysqladmin_no-beep"><code class="option">--no-beep</code></a>,
            <code class="option">-b</code>
          </p><p>
            Suppress the warning beep that is emitted by default for
            errors such as a failure to connect to the server.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_no-defaults"></a>
            <a class="indexterm" name="idm46444428328944"></a>

            <a class="indexterm" name="idm46444428327456"></a>

            <a class="link" href="programs.html#option_mysqladmin_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqladmin_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqladmin_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_password"></a>
            <a class="indexterm" name="idm46444428316064"></a>

            <a class="indexterm" name="idm46444428314576"></a>

            <a class="link" href="programs.html#option_mysqladmin_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqladmin_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> should not prompt for one, use
            the
            <a class="link" href="programs.html#option_mysqladmin_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_pipe"></a>
            <a class="indexterm" name="idm46444428301856"></a>

            <a class="indexterm" name="idm46444428300400"></a>

            <a class="link" href="programs.html#option_mysqladmin_pipe"><code class="option">--pipe</code></a>,
            <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_plugin-dir"></a>
            <a class="indexterm" name="idm46444428293008"></a>

            <a class="indexterm" name="idm46444428291520"></a>

            <a class="link" href="programs.html#option_mysqladmin_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqladmin_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_port"></a>
            <a class="indexterm" name="idm46444428284032"></a>

            <a class="indexterm" name="idm46444428282576"></a>

            <a class="link" href="programs.html#option_mysqladmin_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_print-defaults"></a>
            <a class="indexterm" name="idm46444428277472"></a>

            <a class="indexterm" name="idm46444428275984"></a>

            <a class="link" href="programs.html#option_mysqladmin_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_protocol"></a>
            <a class="indexterm" name="idm46444428270624"></a>

            <a class="indexterm" name="idm46444428269136"></a>

            <a class="link" href="programs.html#option_mysqladmin_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_relative"></a>
            <a class="indexterm" name="idm46444428264080"></a>

            <a class="indexterm" name="idm46444428262592"></a>

            <a class="link" href="programs.html#option_mysqladmin_relative"><code class="option">--relative</code></a>,
            <code class="option">-r</code>
          </p><p>
            Show the difference between the current and previous values
            when used with the
            <a class="link" href="programs.html#option_mysqladmin_sleep"><code class="option">--sleep</code></a> option. This
            option works only with the
            <code class="literal">extended-status</code> command.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_server-public-key-path"></a>
            <a class="indexterm" name="idm46444428256208"></a>

            <a class="indexterm" name="idm46444428254704"></a>

            <a class="link" href="programs.html#option_mysqladmin_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqladmin_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqladmin_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444428240832"></a>

            <a class="indexterm" name="idm46444428239376"></a>

            <a class="link" href="programs.html#option_mysqladmin_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_show-warnings"></a>
            <a class="indexterm" name="idm46444428232256"></a>

            <a class="indexterm" name="idm46444428230768"></a>

            <a class="link" href="programs.html#option_mysqladmin_show-warnings"><code class="option">--show-warnings</code></a>
          </p><p>
            Show warnings resulting from execution of statements sent to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_silent"></a>
            <a class="indexterm" name="idm46444428226576"></a>

            <a class="indexterm" name="idm46444428225088"></a>

            <a class="link" href="programs.html#option_mysqladmin_silent"><code class="option">--silent</code></a>,
            <code class="option">-s</code>
          </p><p>
            Exit silently if a connection to the server cannot be
            established.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_sleep"></a>
            <a class="indexterm" name="idm46444428220496"></a>

            <a class="indexterm" name="idm46444428219040"></a>

            <a class="link" href="programs.html#option_mysqladmin_sleep"><code class="option">--sleep=<em class="replaceable"><code>delay</code></em></code></a>,
            <code class="option">-i <em class="replaceable"><code>delay</code></em></code>
          </p><p>
            Execute commands repeatedly, sleeping for
            <em class="replaceable"><code>delay</code></em> seconds in between. The
            <a class="link" href="programs.html#option_mysqladmin_count"><code class="option">--count</code></a> option determines
            the number of iterations. If
            <a class="link" href="programs.html#option_mysqladmin_count"><code class="option">--count</code></a> is not given,
            <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a> executes commands indefinitely
            until interrupted.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_socket"></a>
            <a class="indexterm" name="idm46444428210128"></a>

            <a class="indexterm" name="idm46444428208640"></a>

            <a class="link" href="programs.html#option_mysqladmin_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_ssl"></a>
            <a class="indexterm" name="idm46444428199536"></a>

            <a class="indexterm" name="idm46444428198080"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqladmin_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444428192128"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqladmin_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqladmin_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqladmin_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqladmin_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqladmin_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444428175008"></a>

            <a class="indexterm" name="idm46444428173520"></a>

            <a class="link" href="programs.html#option_mysqladmin_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_tls-version"></a>
            <a class="indexterm" name="idm46444428167712"></a>

            <a class="indexterm" name="idm46444428166224"></a>

            <a class="link" href="programs.html#option_mysqladmin_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_user"></a>
            <a class="indexterm" name="idm46444428160848"></a>

            <a class="indexterm" name="idm46444428159392"></a>

            <a class="link" href="programs.html#option_mysqladmin_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_verbose"></a>
            <a class="indexterm" name="idm46444428154304"></a>

            <a class="indexterm" name="idm46444428152816"></a>

            <a class="link" href="programs.html#option_mysqladmin_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_version"></a>
            <a class="indexterm" name="idm46444428148224"></a>

            <a class="indexterm" name="idm46444428146736"></a>

            <a class="link" href="programs.html#option_mysqladmin_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_vertical"></a>
            <a class="indexterm" name="idm46444428142176"></a>

            <a class="indexterm" name="idm46444428140688"></a>

            <a class="link" href="programs.html#option_mysqladmin_vertical"><code class="option">--vertical</code></a>,
            <code class="option">-E</code>
          </p><p>
            Print output vertically. This is similar to
            <a class="link" href="programs.html#option_mysqladmin_relative"><code class="option">--relative</code></a>, but prints
            output vertically.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_wait"></a>
            <a class="indexterm" name="idm46444428135104"></a>

            <a class="indexterm" name="idm46444428133648"></a>

            <a class="link" href="programs.html#option_mysqladmin_wait"><code class="option">--wait[=<em class="replaceable"><code>count</code></em>]</code></a>,
            <code class="option">-w[<em class="replaceable"><code>count</code></em>]</code>
          </p><p>
            If the connection cannot be established, wait and retry
            instead of aborting. If a <em class="replaceable"><code>count</code></em>
            value is given, it indicates the number of times to retry.
            The default is one time.
          </p></li><li class="listitem"><p><a name="option_mysqladmin_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqladmin_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444428126176"></a><a class="indexterm" name="idm46444428124672"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>
<p>
        You can also set the following variables by using
        <code class="option">--<em class="replaceable"><code>var_name</code></em>=<em class="replaceable"><code>value</code></em></code>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqladmin_connect_timeout"></a>
            <a class="indexterm" name="idm46444428115552"></a>

            <a class="indexterm" name="idm46444428114512"></a>

            <code class="literal">connect_timeout</code>
          </p><p>
            The maximum number of seconds before connection timeout. The
            default value is 43200 (12 hours).
          </p></li><li class="listitem"><p><a name="option_mysqladmin_shutdown_timeout"></a>
            <a class="indexterm" name="idm46444428110576"></a>

            <a class="indexterm" name="idm46444428109536"></a>

            <code class="literal">shutdown_timeout</code>
          </p><p>
            The maximum number of seconds to wait for server shutdown.
            The default value is 3600 (1 hour).
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqlcheck"></a>4.5.3 <span class="command"><strong>mysqlcheck</strong></span> — A Table Maintenance Program</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444428104720"></a><a class="indexterm" name="idm46444428103776"></a><a class="indexterm" name="idm46444428102416"></a><a class="indexterm" name="idm46444428101056"></a><a class="indexterm" name="idm46444428099696"></a><p>
        The <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> client performs table
        maintenance: It checks, repairs, optimizes, or analyzes tables.
      </p><p>
        Each table is locked and therefore unavailable to other sessions
        while it is being processed, although for check operations, the
        table is locked with a <code class="literal">READ</code> lock only (see
        <a class="xref" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements">Section 13.3.6, “LOCK TABLES and UNLOCK TABLES Statements”</a>, for more information about
        <code class="literal">READ</code> and <code class="literal">WRITE</code> locks).
        Table maintenance operations can be time-consuming, particularly
        for large tables. If you use the
        <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a> or
        <a class="link" href="programs.html#option_mysqlcheck_all-databases"><code class="option">--all-databases</code></a> option to
        process all tables in one or more databases, an invocation of
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> might take a long time. (This is
        also true for the MySQL upgrade procedure if it determines that
        table checking is needed because it processes tables the same
        way.)
      </p><p>
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> must be used when the
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server is running, which means that
        you do not have to stop the server to perform table maintenance.
      </p><p>
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> uses the SQL statements
        <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a>,
        <a class="link" href="sql-statements.html#repair-table" title="13.7.3.5 REPAIR TABLE Statement"><code class="literal">REPAIR TABLE</code></a>,
        <a class="link" href="sql-statements.html#analyze-table" title="13.7.3.1 ANALYZE TABLE Statement"><code class="literal">ANALYZE TABLE</code></a>, and
        <a class="link" href="sql-statements.html#optimize-table" title="13.7.3.4 OPTIMIZE TABLE Statement"><code class="literal">OPTIMIZE TABLE</code></a> in a convenient
        way for the user. It determines which statements to use for the
        operation you want to perform, and then sends the statements to
        the server to be executed. For details about which storage
        engines each statement works with, see the descriptions for
        those statements in
        <a class="xref" href="sql-statements.html#table-maintenance-statements" title="13.7.3 Table Maintenance Statements">Section 13.7.3, “Table Maintenance Statements”</a>.
      </p><p>
        All storage engines do not necessarily support all four
        maintenance operations. In such cases, an error message is
        displayed. For example, if <code class="literal">test.t</code> is an
        <code class="literal">MEMORY</code> table, an attempt to check it produces
        this result:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlcheck test t</code></strong>
test.t
note     : The storage engine for the table doesn't support check
</pre><p>
        If <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> is unable to repair a table,
        see <a class="xref" href="installing.html#rebuilding-tables" title="2.11.13 Rebuilding or Repairing Tables or Indexes">Section 2.11.13, “Rebuilding or Repairing Tables or Indexes”</a> for manual table repair
        strategies. This will be the case, for example, for
        <code class="literal">InnoDB</code> tables, which can be checked with
        <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a>, but not repaired
        with <a class="link" href="sql-statements.html#repair-table" title="13.7.3.5 REPAIR TABLE Statement"><code class="literal">REPAIR TABLE</code></a>.
</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Caution
</div>
<p>
          It is best to make a backup of a table before performing a
          table repair operation; under some circumstances the operation
          might cause data loss. Possible causes include but are not
          limited to file system errors.
</p>
</div>
<p>
        There are three general ways to invoke
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlcheck [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>db_name</code></em> [<em class="replaceable"><code>tbl_name</code></em> ...]</code></strong>
shell&gt; <strong class="userinput"><code>mysqlcheck [<em class="replaceable"><code>options</code></em>] --databases <em class="replaceable"><code>db_name</code></em> ...</code></strong>
shell&gt; <strong class="userinput"><code>mysqlcheck [<em class="replaceable"><code>options</code></em>] --all-databases</code></strong>
</pre><p>
        If you do not name any tables following
        <em class="replaceable"><code>db_name</code></em> or if you use the
        <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a> or
        <a class="link" href="programs.html#option_mysqlcheck_all-databases"><code class="option">--all-databases</code></a> option,
        entire databases are checked.
      </p><p>
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> has a special feature compared to
        other client programs. The default behavior of checking tables
        (<a class="link" href="programs.html#option_mysqlcheck_check"><code class="option">--check</code></a>) can be changed by
        renaming the binary. If you want to have a tool that repairs
        tables by default, you should just make a copy of
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> named
        <span class="command"><strong>mysqlrepair</strong></span>, or make a symbolic link to
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> named
        <span class="command"><strong>mysqlrepair</strong></span>. If you invoke
        <span class="command"><strong>mysqlrepair</strong></span>, it repairs tables.
      </p><p>
        The names shown in the following table can be used to change
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> default behavior.
</p>
<div class="informaltable">
<table summary="Command names that can be used to change mysqlcheck default behavior."><col width="25%"><col width="75%"><thead><tr>
            <th scope="col">Command</th>
            <th scope="col">Meaning</th>
          </tr></thead><tbody><tr>
            <td scope="row"><span class="command"><strong>mysqlrepair</strong></span></td>
            <td>The default option is <a class="link" href="programs.html#option_mysqlcheck_repair"><code class="option">--repair</code></a></td>
          </tr><tr>
            <td scope="row"><span class="command"><strong>mysqlanalyze</strong></span></td>
            <td>The default option is <a class="link" href="programs.html#option_mysqlcheck_analyze"><code class="option">--analyze</code></a></td>
          </tr><tr>
            <td scope="row"><span class="command"><strong>mysqloptimize</strong></span></td>
            <td>The default option is <a class="link" href="programs.html#option_mysqlcheck_optimize"><code class="option">--optimize</code></a></td>
</tr></tbody></table>
</div>
<p>
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqlcheck]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444428027648"></a><p class="title"><b>Table 4.13 mysqlcheck Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqlcheck."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_all-databases">--all-databases</a></td>
<td>Check all tables in all databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_all-in-1">--all-in-1</a></td>
<td>Execute a single statement for each database that names all the tables from that database</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_analyze">--analyze</a></td>
<td>Analyze the tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_auto-repair">--auto-repair</a></td>
<td>If a checked table is corrupted, automatically fix it</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_character-sets-dir">--character-sets-dir</a></td>
<td>Directory where character sets are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_check">--check</a></td>
<td>Check the tables for errors</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_check-only-changed">--check-only-changed</a></td>
<td>Check only tables that have changed since the last check</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_check-upgrade">--check-upgrade</a></td>
<td>Invoke CHECK TABLE with the FOR UPGRADE option</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_databases">--databases</a></td>
<td>Interpret all arguments as database names</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_extended">--extended</a></td>
<td>Check and repair tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_fast">--fast</a></td>
<td>Check only tables that have not been closed properly</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_force">--force</a></td>
<td>Continue even if an SQL error occurs</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_medium-check">--medium-check</a></td>
<td>Do a check that is faster than an --extended operation</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_optimize">--optimize</a></td>
<td>Optimize the tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_quick">--quick</a></td>
<td>The fastest method of checking</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_repair">--repair</a></td>
<td>Perform a repair that can fix almost anything except unique keys that are not unique</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_silent">--silent</a></td>
<td>Silent mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_skip-database">--skip-database</a></td>
<td>Omit this database from performed operations</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_tables">--tables</a></td>
<td>Overrides the --databases or -B option</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_use-frm">--use-frm</a></td>
<td>For repair operations on MyISAM tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_write-binlog">--write-binlog</a></td>
<td>Log ANALYZE, OPTIMIZE, REPAIR statements to binary log. --skip-write-binlog adds NO_WRITE_TO_BINLOG to these statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlcheck_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqlcheck_help"></a>
            <a class="indexterm" name="idm46444427740368"></a>

            <a class="indexterm" name="idm46444427738912"></a>

            <a class="link" href="programs.html#option_mysqlcheck_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_all-databases"></a>
            <a class="indexterm" name="idm46444427734336"></a>

            <a class="indexterm" name="idm46444427732848"></a>

            <a class="link" href="programs.html#option_mysqlcheck_all-databases"><code class="option">--all-databases</code></a>,
            <code class="option">-A</code>
          </p><p>
            Check all tables in all databases. This is the same as using
            the <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a> option
            and naming all the databases on the command line, except
            that the <code class="literal">INFORMATION_SCHEMA</code> and
            <code class="literal">performance_schema</code> databases are not
            checked. They can be checked by explicitly naming them with
            the <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a> option.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_all-in-1"></a>
            <a class="indexterm" name="idm46444427724656"></a>

            <a class="indexterm" name="idm46444427723168"></a>

            <a class="link" href="programs.html#option_mysqlcheck_all-in-1"><code class="option">--all-in-1</code></a>,
            <code class="option">-1</code>
          </p><p>
            Instead of issuing a statement for each table, execute a
            single statement for each database that names all the tables
            from that database to be processed.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_analyze"></a>
            <a class="indexterm" name="idm46444427718464"></a>

            <a class="indexterm" name="idm46444427716976"></a>

            <a class="link" href="programs.html#option_mysqlcheck_analyze"><code class="option">--analyze</code></a>,
            <code class="option">-a</code>
          </p><p>
            Analyze the tables.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_auto-repair"></a>
            <a class="indexterm" name="idm46444427712384"></a>

            <a class="indexterm" name="idm46444427710896"></a>

            <a class="link" href="programs.html#option_mysqlcheck_auto-repair"><code class="option">--auto-repair</code></a>
          </p><p>
            If a checked table is corrupted, automatically fix it. Any
            necessary repairs are done after all tables have been
            checked.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_bind-address"></a>
            <a class="indexterm" name="idm46444427706640"></a>

            <a class="indexterm" name="idm46444427705152"></a>

            <a class="link" href="programs.html#option_mysqlcheck_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_character-sets-dir"></a>
            <a class="indexterm" name="idm46444427700608"></a>

            <a class="indexterm" name="idm46444427699152"></a>

            <a class="link" href="programs.html#option_mysqlcheck_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_check"></a>
            <a class="indexterm" name="idm46444427694016"></a>

            <a class="indexterm" name="idm46444427692560"></a>

            <a class="link" href="programs.html#option_mysqlcheck_check"><code class="option">--check</code></a>,
            <code class="option">-c</code>
          </p><p>
            Check the tables for errors. This is the default operation.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_check-only-changed"></a>
            <a class="indexterm" name="idm46444427687968"></a>

            <a class="indexterm" name="idm46444427686512"></a>

            <a class="link" href="programs.html#option_mysqlcheck_check-only-changed"><code class="option">--check-only-changed</code></a>,
            <code class="option">-C</code>
          </p><p>
            Check only tables that have changed since the last check or
            that have not been closed properly.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_check-upgrade"></a>
            <a class="indexterm" name="idm46444427681824"></a>

            <a class="indexterm" name="idm46444427680336"></a>

            <a class="link" href="programs.html#option_mysqlcheck_check-upgrade"><code class="option">--check-upgrade</code></a>,
            <code class="option">-g</code>
          </p><p>
            Invoke <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a> with the
            <code class="literal">FOR UPGRADE</code> option to check tables for
            incompatibilities with the current version of the server.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_compress"></a>
            <a class="indexterm" name="idm46444427673728"></a>

            <a class="indexterm" name="idm46444427672240"></a>

            <a class="link" href="programs.html#option_mysqlcheck_compress"><code class="option">--compress</code></a>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqlcheck_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444427664608"></a><a class="indexterm" name="idm46444427663104"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_databases"></a>
            <a class="indexterm" name="idm46444427656288"></a>

            <a class="indexterm" name="idm46444427654800"></a>

            <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a>,
            <code class="option">-B</code>
          </p><p>
            Process all tables in the named databases. Normally,
            <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> treats the first name argument
            on the command line as a database name and any following
            names as table names. With this option, it treats all name
            arguments as database names.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_debug"></a>
            <a class="indexterm" name="idm46444427648832"></a>

            <a class="indexterm" name="idm46444427647376"></a>

            <a class="link" href="programs.html#option_mysqlcheck_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is <code class="literal">d:t:o</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_debug-check"></a>
            <a class="indexterm" name="idm46444427637808"></a>

            <a class="indexterm" name="idm46444427636320"></a>

            <a class="link" href="programs.html#option_mysqlcheck_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_debug-info"></a>
            <a class="indexterm" name="idm46444427630224"></a>

            <a class="indexterm" name="idm46444427628736"></a>

            <a class="link" href="programs.html#option_mysqlcheck_debug-info"><code class="option">--debug-info</code></a>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_default-character-set"></a>
            <a class="indexterm" name="idm46444427622592"></a>

            <a class="indexterm" name="idm46444427621136"></a>

            <a class="link" href="programs.html#option_mysqlcheck_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444427615520"></a>

            <a class="indexterm" name="idm46444427614064"></a>

            <a class="link" href="programs.html#option_mysqlcheck_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_defaults-file"></a>
            <a class="indexterm" name="idm46444427607664"></a>

            <a class="indexterm" name="idm46444427606176"></a>

            <a class="link" href="programs.html#option_mysqlcheck_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444427597744"></a>

            <a class="indexterm" name="idm46444427596288"></a>

            <a class="link" href="programs.html#option_mysqlcheck_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqlcheck]</code> groups. If the
            <a class="link" href="programs.html#option_mysqlcheck_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> also reads
            the <code class="literal">[client_other]</code> and
            <code class="literal">[mysqlcheck_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_extended"></a>
            <a class="indexterm" name="idm46444427583728"></a>

            <a class="indexterm" name="idm46444427582240"></a>

            <a class="link" href="programs.html#option_mysqlcheck_extended"><code class="option">--extended</code></a>,
            <code class="option">-e</code>
          </p><p>
            If you are using this option to check tables, it ensures
            that they are 100% consistent but takes a long time.
          </p><p>
            If you are using this option to repair tables, it runs an
            extended repair that may not only take a long time to
            execute, but may produce a lot of garbage rows also!
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_default-auth"></a>
            <a class="indexterm" name="idm46444427576992"></a>

            <a class="indexterm" name="idm46444427575504"></a>

            <a class="link" href="programs.html#option_mysqlcheck_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444427570240"></a>

            <a class="indexterm" name="idm46444427568784"></a>

            <a class="link" href="programs.html#option_mysqlcheck_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_fast"></a>
            <a class="indexterm" name="idm46444427563152"></a>

            <a class="indexterm" name="idm46444427561696"></a>

            <a class="link" href="programs.html#option_mysqlcheck_fast"><code class="option">--fast</code></a>,
            <code class="option">-F</code>
          </p><p>
            Check only tables that have not been closed properly.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_force"></a>
            <a class="indexterm" name="idm46444427557200"></a>

            <a class="indexterm" name="idm46444427555744"></a>

            <a class="link" href="programs.html#option_mysqlcheck_force"><code class="option">--force</code></a>,
            <code class="option">-f</code>
          </p><p>
            Continue even if an SQL error occurs.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_get-server-public-key"></a>
            <a class="indexterm" name="idm46444427551168"></a>

            <a class="indexterm" name="idm46444427549712"></a>

            <a class="link" href="programs.html#option_mysqlcheck_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlcheck_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlcheck_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_host"></a>
            <a class="indexterm" name="idm46444427539536"></a>

            <a class="indexterm" name="idm46444427538080"></a>

            <a class="link" href="programs.html#option_mysqlcheck_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_login-path"></a>
            <a class="indexterm" name="idm46444427532976"></a>

            <a class="indexterm" name="idm46444427531488"></a>

            <a class="link" href="programs.html#option_mysqlcheck_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_medium-check"></a>
            <a class="indexterm" name="idm46444427522576"></a>

            <a class="indexterm" name="idm46444427521088"></a>

            <a class="link" href="programs.html#option_mysqlcheck_medium-check"><code class="option">--medium-check</code></a>,
            <code class="option">-m</code>
          </p><p>
            Do a check that is faster than an
            <a class="link" href="programs.html#option_mysqlcheck_extended"><code class="option">--extended</code></a> operation.
            This finds only 99.99% of all errors, which should be good
            enough in most cases.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_no-defaults"></a>
            <a class="indexterm" name="idm46444427515376"></a>

            <a class="indexterm" name="idm46444427513888"></a>

            <a class="link" href="programs.html#option_mysqlcheck_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqlcheck_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqlcheck_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_optimize"></a>
            <a class="indexterm" name="idm46444427502496"></a>

            <a class="indexterm" name="idm46444427501008"></a>

            <a class="link" href="programs.html#option_mysqlcheck_optimize"><code class="option">--optimize</code></a>,
            <code class="option">-o</code>
          </p><p>
            Optimize the tables.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_password"></a>
            <a class="indexterm" name="idm46444427496464"></a>

            <a class="indexterm" name="idm46444427494976"></a>

            <a class="link" href="programs.html#option_mysqlcheck_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqlcheck_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> should not prompt for one, use
            the
            <a class="link" href="programs.html#option_mysqlcheck_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_pipe"></a>
            <a class="indexterm" name="idm46444427482256"></a>

            <a class="indexterm" name="idm46444427480800"></a>

            <a class="link" href="programs.html#option_mysqlcheck_pipe"><code class="option">--pipe</code></a>,
            <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_plugin-dir"></a>
            <a class="indexterm" name="idm46444427473408"></a>

            <a class="indexterm" name="idm46444427471920"></a>

            <a class="link" href="programs.html#option_mysqlcheck_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqlcheck_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_port"></a>
            <a class="indexterm" name="idm46444427464432"></a>

            <a class="indexterm" name="idm46444427462976"></a>

            <a class="link" href="programs.html#option_mysqlcheck_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_print-defaults"></a>
            <a class="indexterm" name="idm46444427457872"></a>

            <a class="indexterm" name="idm46444427456384"></a>

            <a class="link" href="programs.html#option_mysqlcheck_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_protocol"></a>
            <a class="indexterm" name="idm46444427451024"></a>

            <a class="indexterm" name="idm46444427449536"></a>

            <a class="link" href="programs.html#option_mysqlcheck_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_quick"></a>
            <a class="indexterm" name="idm46444427444528"></a>

            <a class="indexterm" name="idm46444427443072"></a>

            <a class="link" href="programs.html#option_mysqlcheck_quick"><code class="option">--quick</code></a>,
            <code class="option">-q</code>
          </p><p>
            If you are using this option to check tables, it prevents
            the check from scanning the rows to check for incorrect
            links. This is the fastest check method.
          </p><p>
            If you are using this option to repair tables, it tries to
            repair only the index tree. This is the fastest repair
            method.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_repair"></a>
            <a class="indexterm" name="idm46444427437776"></a>

            <a class="indexterm" name="idm46444427436288"></a>

            <a class="link" href="programs.html#option_mysqlcheck_repair"><code class="option">--repair</code></a>,
            <code class="option">-r</code>
          </p><p>
            Perform a repair that can fix almost anything except unique
            keys that are not unique.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_server-public-key-path"></a>
            <a class="indexterm" name="idm46444427431568"></a>

            <a class="indexterm" name="idm46444427430112"></a>

            <a class="link" href="programs.html#option_mysqlcheck_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlcheck_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlcheck_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444427416240"></a>

            <a class="indexterm" name="idm46444427414784"></a>

            <a class="link" href="programs.html#option_mysqlcheck_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_silent"></a>
            <a class="indexterm" name="idm46444427407664"></a>

            <a class="indexterm" name="idm46444427406176"></a>

            <a class="link" href="programs.html#option_mysqlcheck_silent"><code class="option">--silent</code></a>,
            <code class="option">-s</code>
          </p><p>
            Silent mode. Print only error messages.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_skip-database"></a>
            <a class="indexterm" name="idm46444427401616"></a>

            <a class="indexterm" name="idm46444427400128"></a>

            <a class="link" href="programs.html#option_mysqlcheck_skip-database"><code class="option">--skip-database=<em class="replaceable"><code>db_name</code></em></code></a>
          </p><p>
            Do not include the named database (case-sensitive) in the
            operations performed by <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_socket"></a>
            <a class="indexterm" name="idm46444427394416"></a>

            <a class="indexterm" name="idm46444427392928"></a>

            <a class="link" href="programs.html#option_mysqlcheck_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_ssl"></a>
            <a class="indexterm" name="idm46444427383824"></a>

            <a class="indexterm" name="idm46444427382368"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqlcheck_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444427376416"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqlcheck_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqlcheck_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqlcheck_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqlcheck_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlcheck_tables"></a>
            <a class="indexterm" name="idm46444427359296"></a>

            <a class="indexterm" name="idm46444427357808"></a>

            <a class="link" href="programs.html#option_mysqlcheck_tables"><code class="option">--tables</code></a>
          </p><p>
            Override the <a class="link" href="programs.html#option_mysqlcheck_databases"><code class="option">--databases</code></a>
            or <code class="option">-B</code> option. All name arguments following
            the option are regarded as table names.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444427352208"></a>

            <a class="indexterm" name="idm46444427350720"></a>

            <a class="link" href="programs.html#option_mysqlcheck_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_tls-version"></a>
            <a class="indexterm" name="idm46444427344848"></a>

            <a class="indexterm" name="idm46444427343360"></a>

            <a class="link" href="programs.html#option_mysqlcheck_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_use-frm"></a>
            <a class="indexterm" name="idm46444427337984"></a>

            <a class="indexterm" name="idm46444427336496"></a>

            <a class="link" href="programs.html#option_mysqlcheck_use-frm"><code class="option">--use-frm</code></a>
          </p><p>
            For repair operations on <code class="literal">MyISAM</code> tables,
            get the table structure from the data dictionary so that the
            table can be repaired even if the <code class="filename">.MYI</code>
            header is corrupted.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_user"></a>
            <a class="indexterm" name="idm46444427330848"></a>

            <a class="indexterm" name="idm46444427329392"></a>

            <a class="link" href="programs.html#option_mysqlcheck_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_verbose"></a>
            <a class="indexterm" name="idm46444427324192"></a>

            <a class="indexterm" name="idm46444427322704"></a>

            <a class="link" href="programs.html#option_mysqlcheck_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print information about the various stages of
            program operation.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_version"></a>
            <a class="indexterm" name="idm46444427318096"></a>

            <a class="indexterm" name="idm46444427316608"></a>

            <a class="link" href="programs.html#option_mysqlcheck_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_write-binlog"></a>
            <a class="indexterm" name="idm46444427312048"></a>

            <a class="indexterm" name="idm46444427310560"></a>

            <a class="link" href="programs.html#option_mysqlcheck_write-binlog"><code class="option">--write-binlog</code></a>
          </p><p>
            This option is enabled by default, so that
            <a class="link" href="sql-statements.html#analyze-table" title="13.7.3.1 ANALYZE TABLE Statement"><code class="literal">ANALYZE TABLE</code></a>,
            <a class="link" href="sql-statements.html#optimize-table" title="13.7.3.4 OPTIMIZE TABLE Statement"><code class="literal">OPTIMIZE TABLE</code></a>, and
            <a class="link" href="sql-statements.html#repair-table" title="13.7.3.5 REPAIR TABLE Statement"><code class="literal">REPAIR TABLE</code></a> statements
            generated by <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> are written to
            the binary log. Use
            <a class="link" href="programs.html#option_mysqlcheck_write-binlog"><code class="option">--skip-write-binlog</code></a>
            to cause <code class="literal">NO_WRITE_TO_BINLOG</code> to be added
            to the statements so that they are not logged. Use the
            <a class="link" href="programs.html#option_mysqlcheck_write-binlog"><code class="option">--skip-write-binlog</code></a>
            when these statements should not be sent to replication
            slaves or run when using the binary logs for recovery from
            backup.
          </p></li><li class="listitem"><p><a name="option_mysqlcheck_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqlcheck_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444427297008"></a><a class="indexterm" name="idm46444427295504"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqldump"></a>4.5.4 <span class="command"><strong>mysqldump</strong></span> — A Database Backup Program</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444427287488"></a><a class="indexterm" name="idm46444427286544"></a><a class="indexterm" name="idm46444427285184"></a><a class="indexterm" name="idm46444427283824"></a><a class="indexterm" name="idm46444427282464"></a><p>
        The <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> client utility performs
        <a class="link" href="glossary.html#glos_logical_backup" title="logical backup">logical backups</a>,
        producing a set of SQL statements that can be executed to
        reproduce the original database object definitions and table
        data. It dumps one or more MySQL databases for backup or
        transfer to another SQL server. The <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>
        command can also generate output in CSV, other delimited text,
        or XML format.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-performance" title="Performance and Scalability Considerations">Performance and Scalability Considerations</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-syntax" title="Invocation Syntax">Invocation Syntax</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-option-summary" title="Option Syntax - Alphabetical Summary">Option Syntax - Alphabetical Summary</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-connection-options" title="Connection Options">Connection Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-option-file-options" title="Option-File Options">Option-File Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-ddl-options" title="DDL Options">DDL Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-debug-options" title="Debug Options">Debug Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-help-options" title="Help Options">Help Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-i18n-options" title="Internationalization Options">Internationalization Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-replication-options" title="Replication Options">Replication Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-format-options" title="Format Options">Format Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-filter-options" title="Filtering Options">Filtering Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-performance-options" title="Performance Options">Performance Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-transaction-options" title="Transactional Options">Transactional Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-option-groups" title="Option Groups">Option Groups</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-option-examples" title="Examples">Examples</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqldump-restrictions" title="Restrictions">Restrictions</a></p></li></ul>
</div>
<p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> requires at least the
        <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> privilege for dumped
        tables, <a class="link" href="security.html#priv_show-view"><code class="literal">SHOW VIEW</code></a> for dumped
        views, <a class="link" href="security.html#priv_trigger"><code class="literal">TRIGGER</code></a> for dumped
        triggers, and <a class="link" href="security.html#priv_lock-tables"><code class="literal">LOCK TABLES</code></a> if the
        <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a> option is
        not used. Certain options might require other privileges as
        noted in the option descriptions.
      </p><p>
        To reload a dump file, you must have the privileges required to
        execute the statements that it contains, such as the appropriate
        <code class="literal">CREATE</code> privileges for objects created by
        those statements.
      </p><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> output can include
        <a class="link" href="sql-statements.html#alter-database" title="13.1.2 ALTER DATABASE Statement"><code class="literal">ALTER DATABASE</code></a> statements that
        change the database collation. These may be used when dumping
        stored programs to preserve their character encodings. To reload
        a dump file containing such statements, the
        <code class="literal">ALTER</code> privilege for the affected database is
        required.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          A dump made using PowerShell on Windows with output
          redirection creates a file that has UTF-16 encoding:
        </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump [options] &gt; dump.sql</code></strong>
</pre><p>
          However, UTF-16 is not permitted as a connection character set
          (see
          <a class="xref" href="charset.html#charset-connection-impermissible-client-charset" title="Impermissible Client Character Sets">Impermissible Client Character Sets</a>),
          so the dump file will not load correctly. To work around this
          issue, use the <code class="option">--result-file</code> option, which
          creates the output in ASCII format:
        </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump [options] --result-file=dump.sql</code></strong>
</pre>
</div>
<h4><a name="mysqldump-performance"></a>Performance and Scalability Considerations</h4>
<p>
        <code class="literal">mysqldump</code> advantages include the convenience
        and flexibility of viewing or even editing the output before
        restoring. You can clone databases for development and DBA work,
        or produce slight variations of an existing database for
        testing. It is not intended as a fast or scalable solution for
        backing up substantial amounts of data. With large data sizes,
        even if the backup step takes a reasonable time, restoring the
        data can be very slow because replaying the SQL statements
        involves disk I/O for insertion, index creation, and so on.
      </p><p>
        For large-scale backup and restore, a
        <a class="link" href="glossary.html#glos_physical" title="physical">physical</a> backup is more
        appropriate, to copy the data files in their original format
        that can be restored quickly:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            If your tables are primarily <code class="literal">InnoDB</code>
            tables, or if you have a mix of <code class="literal">InnoDB</code>
            and <code class="literal">MyISAM</code> tables, consider using the
            <span class="command"><strong>mysqlbackup</strong></span> command of the MySQL
            Enterprise Backup product. (Available as part of the
            Enterprise subscription.) It provides the best performance
            for <code class="literal">InnoDB</code> backups with minimal
            disruption; it can also back up tables from
            <code class="literal">MyISAM</code> and other storage engines; and it
            provides a number of convenient options to accommodate
            different backup scenarios. See
            <a class="xref" href="mysql-enterprise.html#mysql-enterprise-backup" title="30.2 MySQL Enterprise Backup Overview">Section 30.2, “MySQL Enterprise Backup Overview”</a>.
</p></li></ul>
</div>
<p>
        

        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> can retrieve and dump table
        contents row by row, or it can retrieve the entire content from
        a table and buffer it in memory before dumping it. Buffering in
        memory can be a problem if you are dumping large tables. To dump
        tables row by row, use the
        <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--quick</code></a> option (or
        <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a>, which enables
        <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--quick</code></a>). The
        <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> option (and hence
        <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--quick</code></a>) is enabled by
        default, so to enable memory buffering, use
        <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--skip-quick</code></a>.
      </p><p>
        If you are using a recent version of
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to generate a dump to be reloaded
        into a very old MySQL server, use the
        <a class="link" href="programs.html#option_mysqldump_skip-opt"><code class="option">--skip-opt</code></a> option instead of
        the <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> or
        <a class="link" href="programs.html#option_mysqldump_extended-insert"><code class="option">--extended-insert</code></a> option.
      </p><p>
        For additional information about <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>,
        see <a class="xref" href="backup-and-recovery.html#using-mysqldump" title="7.4 Using mysqldump for Backups">Section 7.4, “Using mysqldump for Backups”</a>.
</p>
<h4><a name="mysqldump-syntax"></a>Invocation Syntax</h4>
<p>
        There are in general three ways to use
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>—in order to dump a set of one
        or more tables, a set of one or more complete databases, or an
        entire MySQL server—as shown here:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>db_name</code></em> [<em class="replaceable"><code>tbl_name</code></em> ...]</code></strong>
shell&gt; <strong class="userinput"><code>mysqldump [<em class="replaceable"><code>options</code></em>] --databases <em class="replaceable"><code>db_name</code></em> ...</code></strong>
shell&gt; <strong class="userinput"><code>mysqldump [<em class="replaceable"><code>options</code></em>] --all-databases</code></strong>
</pre><p>
        To dump entire databases, do not name any tables following
        <em class="replaceable"><code>db_name</code></em>, or use the
        <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> or
        <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option.
      </p><p>
        To see a list of the options your version of
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> supports, issue the command
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump --help</strong></span></a>.
</p>
<h4><a name="mysqldump-option-summary"></a>Option Syntax - Alphabetical Summary</h4>
<p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqldump]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444427192112"></a><p class="title"><b>Table 4.14 mysqldump Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqldump."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_add-drop-database">--add-drop-database</a></td>
<td>Add DROP DATABASE statement before each CREATE DATABASE statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_add-drop-table">--add-drop-table</a></td>
<td>Add DROP TABLE statement before each CREATE TABLE statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_add-drop-trigger">--add-drop-trigger</a></td>
<td>Add DROP TRIGGER statement before each CREATE TRIGGER statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_add-locks">--add-locks</a></td>
<td>Surround each table dump with LOCK TABLES and UNLOCK TABLES statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_all-databases">--all-databases</a></td>
<td>Dump all tables in all databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_allow-keywords">--allow-keywords</a></td>
<td>Allow creation of column names that are keywords</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_apply-slave-statements">--apply-slave-statements</a></td>
<td>Include STOP SLAVE prior to CHANGE MASTER statement and START SLAVE at end of output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_character-sets-dir">--character-sets-dir</a></td>
<td>Directory where character sets are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_column-statistics">--column-statistics</a></td>
<td>Write ANALYZE TABLE statements to generate statistics histograms</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_comments">--comments</a></td>
<td>Add comments to dump file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_compact">--compact</a></td>
<td>Produce more compact output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_compatible">--compatible</a></td>
<td>Produce output that is more compatible with other database systems or with older MySQL servers</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_complete-insert">--complete-insert</a></td>
<td>Use complete INSERT statements that include column names</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_create-options">--create-options</a></td>
<td>Include all MySQL-specific table options in CREATE TABLE statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_databases">--databases</a></td>
<td>Interpret all name arguments as database names</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_delete-master-logs">--delete-master-logs</a></td>
<td>On a master replication server, delete the binary logs after performing the dump operation</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_disable-keys">--disable-keys</a></td>
<td>For each table, surround INSERT statements with statements to disable and enable keys</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_dump-date">--dump-date</a></td>
<td>Include dump date as "Dump completed on" comment if --comments is given</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_dump-slave">--dump-slave</a></td>
<td>Include CHANGE MASTER statement that lists binary log coordinates of slave's master</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_events">--events</a></td>
<td>Dump events from dumped databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_extended-insert">--extended-insert</a></td>
<td>Use multiple-row INSERT syntax</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_fields">--fields-enclosed-by</a></td>
<td>This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_fields">--fields-escaped-by</a></td>
<td>This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_fields">--fields-optionally-enclosed-by</a></td>
<td>This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_fields">--fields-terminated-by</a></td>
<td>This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_flush-logs">--flush-logs</a></td>
<td>Flush MySQL server log files before starting dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_flush-privileges">--flush-privileges</a></td>
<td>Emit a FLUSH PRIVILEGES statement after dumping mysql database</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_force">--force</a></td>
<td>Continue even if an SQL error occurs during a table dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_hex-blob">--hex-blob</a></td>
<td>Dump binary columns using hexadecimal notation</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ignore-error">--ignore-error</a></td>
<td>Ignore specified errors</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ignore-table">--ignore-table</a></td>
<td>Do not dump given table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_include-master-host-port">--include-master-host-port</a></td>
<td>Include MASTER_HOST/MASTER_PORT options in CHANGE MASTER statement produced with --dump-slave</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_insert-ignore">--insert-ignore</a></td>
<td>Write INSERT IGNORE rather than INSERT statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_lines-terminated-by">--lines-terminated-by</a></td>
<td>This option is used with the --tab option and has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_lock-all-tables">--lock-all-tables</a></td>
<td>Lock all tables across all databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_lock-tables">--lock-tables</a></td>
<td>Lock all tables before dumping them</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_log-error">--log-error</a></td>
<td>Append warnings and errors to named file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_master-data">--master-data</a></td>
<td>Write the binary log file name and position to the output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_max-allowed-packet">--max-allowed-packet</a></td>
<td>Maximum packet length to send to or receive from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_net-buffer-length">--net-buffer-length</a></td>
<td>Buffer size for TCP/IP and socket communication</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_network-timeout">--network-timeout</a></td>
<td>Increase network timeouts to permit larger table dumps</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-autocommit">--no-autocommit</a></td>
<td>Enclose the INSERT statements for each dumped table within SET autocommit = 0 and COMMIT statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-create-db">--no-create-db</a></td>
<td>Do not write CREATE DATABASE statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-create-info">--no-create-info</a></td>
<td>Do not write CREATE TABLE statements that re-create each dumped table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-data">--no-data</a></td>
<td>Do not dump table contents</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-set-names">--no-set-names</a></td>
<td>Same as --skip-set-charset</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_no-tablespaces">--no-tablespaces</a></td>
<td>Do not write any CREATE LOGFILE GROUP or CREATE TABLESPACE statements in output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_opt">--opt</a></td>
<td>Shorthand for --add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_order-by-primary">--order-by-primary</a></td>
<td>Dump each table's rows sorted by its primary key, or by its first unique index</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_quick">--quick</a></td>
<td>Retrieve rows for a table from the server a row at a time</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_quote-names">--quote-names</a></td>
<td>Quote identifiers within backtick characters</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_replace">--replace</a></td>
<td>Write REPLACE statements rather than INSERT statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_result-file">--result-file</a></td>
<td>Direct output to a given file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_routines">--routines</a></td>
<td>Dump stored routines (procedures and functions) from dumped databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_set-charset">--set-charset</a></td>
<td>Add SET NAMES default_character_set to output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_set-gtid-purged">--set-gtid-purged</a></td>
<td>Whether to add SET @@GLOBAL.GTID_PURGED to output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_show-create-skip-secondary-engine">--show-create-skip-secondary-engine</a></td>
<td>Exclude SECONDARY ENGINE clause from CREATE TABLE statements</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_single-transaction">--single-transaction</a></td>
<td>Issue a BEGIN SQL statement before dumping data from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_add-drop-table">--skip-add-drop-table</a></td>
<td>Do not add a DROP TABLE statement before each CREATE TABLE statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_add-locks">--skip-add-locks</a></td>
<td>Do not add locks</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_skip-comments">--skip-comments</a></td>
<td>Do not add comments to dump file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_compact">--skip-compact</a></td>
<td>Do not produce more compact output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_disable-keys">--skip-disable-keys</a></td>
<td>Do not disable keys</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_extended-insert">--skip-extended-insert</a></td>
<td>Turn off extended-insert</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_skip-opt">--skip-opt</a></td>
<td>Turn off options set by --opt</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_quick">--skip-quick</a></td>
<td>Do not retrieve rows for a table from the server a row at a time</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_quote-names">--skip-quote-names</a></td>
<td>Do not quote identifiers</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_set-charset">--skip-set-charset</a></td>
<td>Do not write SET NAMES statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_triggers">--skip-triggers</a></td>
<td>Do not dump triggers</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_tz-utc">--skip-tz-utc</a></td>
<td>Turn off tz-utc</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_tab">--tab</a></td>
<td>Produce tab-separated data files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_tables">--tables</a></td>
<td>Override --databases or -B option</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_triggers">--triggers</a></td>
<td>Dump triggers for each dumped table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_tz-utc">--tz-utc</a></td>
<td>Add SET TIME_ZONE='+00:00' to dump file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_where">--where</a></td>
<td>Dump only rows selected by given WHERE condition</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_xml">--xml</a></td>
<td>Produce XML output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldump_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<h4><a name="mysqldump-connection-options"></a>Connection Options</h4>
<p>
        The <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> command logs into a MySQL
        server to extract information. The following options specify how
        to connect to the MySQL server, either on the same machine or a
        remote system.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_bind-address"></a>
            <a class="indexterm" name="idm46444426657824"></a>

            <a class="indexterm" name="idm46444426656336"></a>

            <a class="link" href="programs.html#option_mysqldump_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqldump_compress"></a>
            <a class="indexterm" name="idm46444426651792"></a>

            <a class="indexterm" name="idm46444426650304"></a>

            <code class="option">--compress</code>, <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqldump_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444426642960"></a><a class="indexterm" name="idm46444426641456"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqldump_default-auth"></a>
            <a class="indexterm" name="idm46444426634576"></a>

            <a class="indexterm" name="idm46444426633088"></a>

            <code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444426628368"></a>

            <a class="indexterm" name="idm46444426626912"></a>

            <a class="link" href="programs.html#option_mysqldump_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysqldump_get-server-public-key"></a>
            <a class="indexterm" name="idm46444426621280"></a>

            <a class="indexterm" name="idm46444426619824"></a>

            <a class="link" href="programs.html#option_mysqldump_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqldump_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqldump_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_host"></a>
            <a class="indexterm" name="idm46444426609680"></a>

            <a class="indexterm" name="idm46444426608224"></a>

            <code class="option">--host=<em class="replaceable"><code>host_name</code></em></code>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Dump data from the MySQL server on the given host. The
            default host is <code class="literal">localhost</code>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_login-path"></a>
            <a class="indexterm" name="idm46444426602880"></a>

            <a class="indexterm" name="idm46444426601392"></a>

            <a class="link" href="programs.html#option_mysqldump_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_password"></a>
            <a class="indexterm" name="idm46444426592480"></a>

            <a class="indexterm" name="idm46444426590992"></a>

            <code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqldump_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> should not prompt for one, use
            the
            <a class="link" href="programs.html#option_mysqldump_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqldump_pipe"></a>
            <a class="indexterm" name="idm46444426578816"></a>

            <a class="indexterm" name="idm46444426577360"></a>

            <code class="option">--pipe</code>, <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqldump_plugin-dir"></a>
            <a class="indexterm" name="idm46444426570512"></a>

            <a class="indexterm" name="idm46444426569024"></a>

            <code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqldump_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_port"></a>
            <a class="indexterm" name="idm46444426562080"></a>

            <a class="indexterm" name="idm46444426560624"></a>

            <code class="option">--port=<em class="replaceable"><code>port_num</code></em></code>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqldump_protocol"></a>
            <a class="indexterm" name="idm46444426556032"></a>

            <a class="indexterm" name="idm46444426554544"></a>

            <code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_server-public-key-path"></a>
            <a class="indexterm" name="idm46444426550032"></a>

            <a class="indexterm" name="idm46444426548576"></a>

            <a class="link" href="programs.html#option_mysqldump_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqldump_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqldump_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_socket"></a>
            <a class="indexterm" name="idm46444426534800"></a>

            <a class="indexterm" name="idm46444426533344"></a>

            <code class="option">--socket=<em class="replaceable"><code>path</code></em></code>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqldump_ssl"></a>
            <a class="indexterm" name="idm46444426524784"></a>

            <a class="indexterm" name="idm46444426523328"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqldump_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444426517376"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqldump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqldump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqldump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqldump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqldump_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444426500256"></a>

            <a class="indexterm" name="idm46444426498768"></a>

            <a class="link" href="programs.html#option_mysqldump_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqldump_tls-version"></a>
            <a class="indexterm" name="idm46444426492896"></a>

            <a class="indexterm" name="idm46444426491408"></a>

            <a class="link" href="programs.html#option_mysqldump_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_user"></a>
            <a class="indexterm" name="idm46444426486032"></a>

            <a class="indexterm" name="idm46444426484576"></a>

            <code class="option">--user=<em class="replaceable"><code>user_name</code></em></code>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqldump_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqldump_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444426478592"></a><a class="indexterm" name="idm46444426477088"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>
<h4><a name="mysqldump-option-file-options"></a>Option-File Options</h4>
<p>
        These options are used to control which option files to read.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444426467856"></a>

            <a class="indexterm" name="idm46444426466400"></a>

            <a class="link" href="programs.html#option_mysqldump_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_defaults-file"></a>
            <a class="indexterm" name="idm46444426460000"></a>

            <a class="indexterm" name="idm46444426458512"></a>

            <a class="link" href="programs.html#option_mysqldump_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444426450080"></a>

            <a class="indexterm" name="idm46444426448624"></a>

            <a class="link" href="programs.html#option_mysqldump_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqldump]</code> groups. If the
            <a class="link" href="programs.html#option_mysqldump_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysqldump_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_no-defaults"></a>
            <a class="indexterm" name="idm46444426436064"></a>

            <a class="indexterm" name="idm46444426434576"></a>

            <a class="link" href="programs.html#option_mysqldump_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqldump_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqldump_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_print-defaults"></a>
            <a class="indexterm" name="idm46444426423184"></a>

            <a class="indexterm" name="idm46444426421696"></a>

            <a class="link" href="programs.html#option_mysqldump_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
</p></li></ul>
</div>
<h4><a name="mysqldump-ddl-options"></a>DDL Options</h4>
<p>
        Usage scenarios for <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> include setting
        up an entire new MySQL instance (including database tables), and
        replacing data inside an existing instance with existing
        databases and tables. The following options let you specify
        which things to tear down and set up when restoring a dump, by
        encoding various DDL statements within the dump file.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_add-drop-database"></a>
            <a class="indexterm" name="idm46444426412816"></a>

            <a class="indexterm" name="idm46444426411360"></a>

            <code class="option">--add-drop-database</code>
          </p><p>
            Write a <a class="link" href="sql-statements.html#drop-database" title="13.1.24 DROP DATABASE Statement"><code class="literal">DROP DATABASE</code></a>
            statement before each <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE
            DATABASE</code></a> statement. This option is typically used
            in conjunction with the
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> or
            <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> option because
            no <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE DATABASE</code></a> statements
            are written unless one of those options is specified.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              In MySQL 8.0, the <code class="literal">mysql</code>
              schema is considered a system schema that cannot be
              dropped by end users. If
              <a class="link" href="programs.html#option_mysqldump_add-drop-database"><code class="option">--add-drop-database</code></a> is
              used with
              <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> or with
              <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> where the
              list of schemas to be dumped includes
              <code class="literal">mysql</code>, the dump file will contain a
              <code class="literal">DROP DATABASE `mysql`</code> statement that
              causes an error when the dump file is reloaded.
            </p><p>
              Instead, to use
              <a class="link" href="programs.html#option_mysqldump_add-drop-database"><code class="option">--add-drop-database</code></a>, use
              <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> with a list
              of schemas to be dumped, where the list does not include
              <code class="literal">mysql</code>.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqldump_add-drop-table"></a>
            <a class="indexterm" name="idm46444426392352"></a>

            <a class="indexterm" name="idm46444426390864"></a>

            <code class="option">--add-drop-table</code>
          </p><p>
            Write a <a class="link" href="sql-statements.html#drop-table" title="13.1.32 DROP TABLE Statement"><code class="literal">DROP TABLE</code></a> statement
            before each <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a>
            statement.
          </p></li><li class="listitem"><p><a name="option_mysqldump_add-drop-trigger"></a>
            <a class="indexterm" name="idm46444426384816"></a>

            <a class="indexterm" name="idm46444426383328"></a>

            <code class="option">--add-drop-trigger</code>
          </p><p>
            Write a <a class="link" href="sql-statements.html#drop-trigger" title="13.1.34 DROP TRIGGER Statement"><code class="literal">DROP TRIGGER</code></a>
            statement before each <a class="link" href="sql-statements.html#create-trigger" title="13.1.22 CREATE TRIGGER Statement"><code class="literal">CREATE
            TRIGGER</code></a> statement.
          </p></li><li class="listitem"><p><a name="option_mysqldump_all-tablespaces"></a>
            <a class="indexterm" name="idm46444426376944"></a>

            <a class="indexterm" name="idm46444426375456"></a>

            <code class="option">--all-tablespaces</code>, <code class="option">-Y</code>
          </p><p>
            Adds to a table dump all SQL statements needed to create any
            tablespaces used by an <a class="link" href="mysql-cluster.html" title="Chapter 22 MySQL NDB Cluster 8.0"><code class="literal">NDB</code></a>
            table. This information is not otherwise included in the
            output from <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>. This option is
            currently relevant only to NDB Cluster tables.
          </p></li><li class="listitem"><p><a name="option_mysqldump_no-create-db"></a>
            <a class="indexterm" name="idm46444426368848"></a>

            <a class="indexterm" name="idm46444426367360"></a>

            <code class="option">--no-create-db</code>, <code class="option">-n</code>
          </p><p>
            Suppress the <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE DATABASE</code></a>
            statements that are otherwise included in the output if the
            <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> or
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option is
            given.
          </p></li><li class="listitem"><p><a name="option_mysqldump_no-create-info"></a>
            <a class="indexterm" name="idm46444426360096"></a>

            <a class="indexterm" name="idm46444426358608"></a>

            <code class="option">--no-create-info</code>, <code class="option">-t</code>
          </p><p>
            Do not write <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a>
            statements that create each dumped table.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              This option does <span class="emphasis"><em>not</em></span> exclude
              statements creating log file groups or tablespaces from
              <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> output; however, you can use
              the <a class="link" href="programs.html#option_mysqldump_no-tablespaces"><code class="option">--no-tablespaces</code></a>
              option for this purpose.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqldump_no-tablespaces"></a>
            <a class="indexterm" name="idm46444426349776"></a>

            <a class="indexterm" name="idm46444426348288"></a>

            <code class="option">--no-tablespaces</code>, <code class="option">-y</code>
          </p><p>
            This option suppresses all <a class="link" href="sql-statements.html#create-logfile-group" title="13.1.16 CREATE LOGFILE GROUP Statement"><code class="literal">CREATE
            LOGFILE GROUP</code></a> and <a class="link" href="sql-statements.html#create-tablespace" title="13.1.21 CREATE TABLESPACE Statement"><code class="literal">CREATE
            TABLESPACE</code></a> statements in the output of
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_replace"></a>
            <a class="indexterm" name="idm46444426340448"></a>

            <a class="indexterm" name="idm46444426338960"></a>

            <code class="option">--replace</code>
          </p><p>
            Write <a class="link" href="sql-statements.html#replace" title="13.2.9 REPLACE Statement"><code class="literal">REPLACE</code></a> statements
            rather than <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements.
</p></li></ul>
</div>
<h4><a name="mysqldump-debug-options"></a>Debug Options</h4>
<p>
        The following options print debugging information, encode
        debugging information in the dump file, or let the dump
        operation proceed regardless of potential problems.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_allow-keywords"></a>
            <a class="indexterm" name="idm46444426330816"></a>

            <a class="indexterm" name="idm46444426329328"></a>

            <code class="option">--allow-keywords</code>
          </p><p>
            Permit creation of column names that are keywords. This
            works by prefixing each column name with the table name.
          </p></li><li class="listitem"><p><a name="option_mysqldump_comments"></a>
            <a class="indexterm" name="idm46444426325648"></a>

            <a class="indexterm" name="idm46444426324160"></a>

            <code class="option">--comments</code>, <code class="option">-i</code>
          </p><p>
            Write additional information in the dump file such as
            program version, server version, and host. This option is
            enabled by default. To suppress this additional information,
            use <a class="link" href="programs.html#option_mysqldump_skip-comments"><code class="option">--skip-comments</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_debug"></a>
            <a class="indexterm" name="idm46444426319024"></a>

            <a class="indexterm" name="idm46444426317568"></a>

            <code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default value is
            <code class="literal">d:t:o,/tmp/mysqldump.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqldump_debug-check"></a>
            <a class="indexterm" name="idm46444426308528"></a>

            <a class="indexterm" name="idm46444426307040"></a>

            <code class="option">--debug-check</code>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqldump_debug-info"></a>
            <a class="indexterm" name="idm46444426301488"></a>

            <a class="indexterm" name="idm46444426300000"></a>

            <code class="option">--debug-info</code>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqldump_dump-date"></a>
            <a class="indexterm" name="idm46444426294400"></a>

            <a class="indexterm" name="idm46444426292912"></a>

            <code class="option">--dump-date</code>
          </p><p>
            If the <a class="link" href="programs.html#option_mysqldump_comments"><code class="option">--comments</code></a> option
            is given, <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> produces a comment at
            the end of the dump of the following form:
          </p><pre data-lang="none" class="programlisting">-- Dump completed on <em class="replaceable"><code>DATE</code></em>
</pre><p>
            However, the date causes dump files taken at different times
            to appear to be different, even if the data are otherwise
            identical. <a class="link" href="programs.html#option_mysqldump_dump-date"><code class="option">--dump-date</code></a> and
            <a class="link" href="programs.html#option_mysqldump_dump-date"><code class="option">--skip-dump-date</code></a>
            control whether the date is added to the comment. The
            default is <a class="link" href="programs.html#option_mysqldump_dump-date"><code class="option">--dump-date</code></a>
            (include the date in the comment).
            <a class="link" href="programs.html#option_mysqldump_dump-date"><code class="option">--skip-dump-date</code></a>
            suppresses date printing.
          </p></li><li class="listitem"><p><a name="option_mysqldump_force"></a>
            <a class="indexterm" name="idm46444426280976"></a>

            <a class="indexterm" name="idm46444426279520"></a>

            <code class="option">--force</code>, <code class="option">-f</code>
          </p><p>
            Ignore all errors; continue even if an SQL error occurs
            during a table dump.
          </p><p>
            One use for this option is to cause
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to continue executing even when
            it encounters a view that has become invalid because the
            definition refers to a table that has been dropped. Without
            <code class="option">--force</code>, <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> exits
            with an error message. With <code class="option">--force</code>,
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> prints the error message, but
            it also writes an SQL comment containing the view definition
            to the dump output and continues executing.
          </p><p>
            If the <a class="link" href="programs.html#option_mysqldump_ignore-error"><code class="option">--ignore-error</code></a>
            option is also given to ignore specific errors,
            <a class="link" href="programs.html#option_mysqldump_force"><code class="option">--force</code></a> takes precedence.
          </p></li><li class="listitem"><p><a name="option_mysqldump_log-error"></a>
            <a class="indexterm" name="idm46444426267648"></a>

            <a class="indexterm" name="idm46444426266160"></a>

            <code class="option">--log-error=<em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            Log warnings and errors by appending them to the named file.
            The default is to do no logging.
          </p></li><li class="listitem"><p><a name="option_mysqldump_skip-comments"></a>
            <a class="indexterm" name="idm46444426262208"></a>

            <a class="indexterm" name="idm46444426260720"></a>

            <code class="option">--skip-comments</code>
          </p><p>
            See the description for the
            <a class="link" href="programs.html#option_mysqldump_comments"><code class="option">--comments</code></a> option.
          </p></li><li class="listitem"><p><a name="option_mysqldump_verbose"></a>
            <a class="indexterm" name="idm46444426256144"></a>

            <a class="indexterm" name="idm46444426254656"></a>

            <code class="option">--verbose</code>, <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does.
</p></li></ul>
</div>
<h4><a name="mysqldump-help-options"></a>Help Options</h4>
<p>
        The following options display information about the
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> command itself.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_help"></a>
            <a class="indexterm" name="idm46444426247488"></a>

            <a class="indexterm" name="idm46444426246032"></a>

            <code class="option">--help</code>, <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqldump_version"></a>
            <a class="indexterm" name="idm46444426242000"></a>

            <a class="indexterm" name="idm46444426240512"></a>

            <code class="option">--version</code>, <code class="option">-V</code>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>
<h4><a name="mysqldump-i18n-options"></a>Internationalization Options</h4>
<p>
        The following options change how the
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> command represents character data
        with national language settings.

        
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_character-sets-dir"></a>
            <a class="indexterm" name="idm46444426232400"></a>

            <a class="indexterm" name="idm46444426230944"></a>

            <code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_default-character-set"></a>
            <a class="indexterm" name="idm46444426226304"></a>

            <a class="indexterm" name="idm46444426224848"></a>

            <code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
            If no character set is specified,
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> uses <code class="literal">utf8</code>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_no-set-names"></a>
            <a class="indexterm" name="idm46444426217776"></a>

            <a class="indexterm" name="idm46444426216288"></a>

            <code class="option">--no-set-names</code>, <code class="option">-N</code>
          </p><p>
            Turns off the
            <a class="link" href="programs.html#option_mysqldump_set-charset"><code class="option">--set-charset</code></a> setting, the
            same as specifying <code class="option">--skip-set-charset</code>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_set-charset"></a>
            <a class="indexterm" name="idm46444426210864"></a>

            <a class="indexterm" name="idm46444426209376"></a>

            <code class="option">--set-charset</code>
          </p><p>
            Write <a class="link" href="sql-statements.html#set-names" title="13.7.6.3 SET NAMES Statement"><code class="literal">SET NAMES
            <em class="replaceable"><code>default_character_set</code></em></code></a>
            to the output. This option is enabled by default. To
            suppress the <a class="link" href="sql-statements.html#set-names" title="13.7.6.3 SET NAMES Statement"><code class="literal">SET NAMES</code></a>
            statement, use
            <a class="link" href="programs.html#option_mysqldump_set-charset"><code class="option">--skip-set-charset</code></a>.
</p></li></ul>
</div>
<h4><a name="mysqldump-replication-options"></a>Replication Options</h4>
<p>
        The <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> command is frequently used to
        create an empty instance, or an instance including data, on a
        slave server in a replication configuration. The following
        options apply to dumping and restoring data on replication
        master and slave servers.

        
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_apply-slave-statements"></a>
            <a class="indexterm" name="idm46444454008816"></a>

            <a class="indexterm" name="idm46444454007360"></a>

            <code class="option">--apply-slave-statements</code>
          </p><p>
            For a slave dump produced with the
            <a class="link" href="programs.html#option_mysqldump_dump-slave"><code class="option">--dump-slave</code></a> option, add a
            <a class="link" href="sql-statements.html#stop-slave" title="13.4.2.7 STOP SLAVE Statement"><code class="literal">STOP SLAVE</code></a> statement before
            the <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a>
            statement and a <a class="link" href="sql-statements.html#start-slave" title="13.4.2.6 START SLAVE Statement"><code class="literal">START SLAVE</code></a>
            statement at the end of the output.
          </p></li><li class="listitem"><p><a name="option_mysqldump_delete-master-logs"></a>
            <a class="indexterm" name="idm46444426101920"></a>

            <a class="indexterm" name="idm46444426100464"></a>

            <code class="option">--delete-master-logs</code>
          </p><p>
            On a master replication server, delete the binary logs by
            sending a <a class="link" href="sql-statements.html#purge-binary-logs" title="13.4.1.1 PURGE BINARY LOGS Statement"><code class="literal">PURGE BINARY LOGS</code></a>
            statement to the server after performing the dump operation.
            This option automatically enables
            <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_dump-slave"></a>
            <a class="indexterm" name="idm46444426094448"></a>

            <a class="indexterm" name="idm46444426092960"></a>

            <code class="option">--dump-slave[=<em class="replaceable"><code>value</code></em>]</code>
          </p><p>
            This option is similar to
            <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a> except that
            it is used to dump a replication slave server to produce a
            dump file that can be used to set up another server as a
            slave that has the same master as the dumped server. It
            causes the dump output to include a
            <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a> statement
            that indicates the binary log coordinates (file name and
            position) of the dumped slave's master. The
            <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a> statement
            reads the values of <code class="literal">Relay_Master_Log_File</code>
            and <code class="literal">Exec_Master_Log_Pos</code> from the
            <a class="link" href="sql-statements.html#show-slave-status" title="13.7.7.34 SHOW SLAVE STATUS Statement"><code class="literal">SHOW SLAVE STATUS</code></a> output and
            uses them for <code class="literal">MASTER_LOG_FILE</code> and
            <code class="literal">MASTER_LOG_POS</code> respectively. These are
            the master server coordinates from which the slave should
            start replicating.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              Inconsistencies in the sequence of transactions from the
              relay log which have been executed can cause the wrong
              position to be used. See
              <a class="xref" href="replication.html#replication-features-transaction-inconsistencies" title="17.5.1.33 Replication and Transaction Inconsistencies">Section 17.5.1.33, “Replication and Transaction Inconsistencies”</a>
              for more information.
</p>
</div>
<p>
            <code class="option">--dump-slave</code> causes the coordinates from
            the master to be used rather than those of the dumped
            server, as is done by the
            <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a> option. In
            addition, specfiying this option causes the
            <code class="option">--master-data</code> option to be overridden, if
            used, and effectively ignored.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
              This option should not be used if the server where the
              dump is going to be applied uses
              <a class="link" href="replication.html#sysvar_gtid_mode"><code class="literal">gtid_mode=ON</code></a> and
              <code class="literal">MASTER_AUTOPOSITION=1</code>.
</p>
</div>
<p>
            The option value is handled the same way as for
            <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a> (setting no
            value or 1 causes a <code class="literal">CHANGE MASTER TO</code>
            statement to be written to the dump, setting 2 causes the
            statement to be written but encased in SQL comments) and has
            the same effect as <code class="option">--master-data</code> in terms
            of enabling or disabling other options and in how locking is
            handled.
          </p><p>
            This option causes <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to stop the
            slave SQL thread before the dump and restart it again after.
          </p><p>
            In conjunction with <code class="option">--dump-slave</code>, the
            <a class="link" href="programs.html#option_mysqldump_apply-slave-statements"><code class="option">--apply-slave-statements</code></a>
            and
            <a class="link" href="programs.html#option_mysqldump_include-master-host-port"><code class="option">--include-master-host-port</code></a>
            options can also be used.
          </p></li><li class="listitem"><p><a name="option_mysqldump_include-master-host-port"></a>
            <a class="indexterm" name="idm46444426066704"></a>

            <a class="indexterm" name="idm46444426065200"></a>

            <code class="option">--include-master-host-port</code>
          </p><p>
            For the <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a>
            statement in a slave dump produced with the
            <a class="link" href="programs.html#option_mysqldump_dump-slave"><code class="option">--dump-slave</code></a> option, add
            <code class="literal">MASTER_HOST</code> and
            <code class="literal">MASTER_PORT</code> options for the host name and
            TCP/IP port number of the slave's master.
          </p></li><li class="listitem"><p><a name="option_mysqldump_master-data"></a>
            <a class="indexterm" name="idm46444426057888"></a>

            <a class="indexterm" name="idm46444426056400"></a>

            <code class="option">--master-data[=<em class="replaceable"><code>value</code></em>]</code>
          </p><p>
            Use this option to dump a master replication server to
            produce a dump file that can be used to set up another
            server as a slave of the master. It causes the dump output
            to include a <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a>
            statement that indicates the binary log coordinates (file
            name and position) of the dumped server. These are the
            master server coordinates from which the slave should start
            replicating after you load the dump file into the slave.
          </p><p>
            If the option value is 2, the <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE
            MASTER TO</code></a> statement is written as an SQL comment,
            and thus is informative only; it has no effect when the dump
            file is reloaded. If the option value is 1, the statement is
            not written as a comment and takes effect when the dump file
            is reloaded. If no option value is specified, the default
            value is 1.
          </p><p>
            This option requires the
            <a class="link" href="security.html#priv_reload"><code class="literal">RELOAD</code></a> privilege and the
            binary log must be enabled.
          </p><p>
            The <code class="option">--master-data</code> option automatically
            turns off <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a>.
            It also turns on
            <a class="link" href="programs.html#option_mysqldump_lock-all-tables"><code class="option">--lock-all-tables</code></a>, unless
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a> also
            is specified, in which case, a global read lock is acquired
            only for a short time at the beginning of the dump (see the
            description for
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a>). In
            all cases, any action on logs happens at the exact moment of
            the dump.
          </p><p>
            It is also possible to set up a slave by dumping an existing
            slave of the master, using the
            <a class="link" href="programs.html#option_mysqldump_dump-slave"><code class="option">--dump-slave</code></a> option, which
            overrides <code class="option">--master-data</code> and causes it to be
            ignored if both options are used.
          </p></li><li class="listitem"><p><a name="option_mysqldump_set-gtid-purged"></a>
            <a class="indexterm" name="idm46444426040112"></a>

            <a class="indexterm" name="idm46444426038624"></a>

            <code class="option">--set-gtid-purged=<em class="replaceable"><code>value</code></em></code>
          </p><p>
            This option is for servers that use GTID-based replication
            (<a class="link" href="replication.html#sysvar_gtid_mode"><code class="literal">gtid_mode=ON</code></a>). It controls
            the inclusion of a <code class="literal">SET
            @@GLOBAL.gtid_purged</code> statement in the dump output,
            which updates the value of
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> on a server
            where the dump file is reloaded, to add the GTID set from
            the source server's
            <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> system
            variable. <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> holds
            the GTIDs of all transactions that have been applied on the
            server, but do not exist on any binary log file on the
            server. <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> therefore adds the
            GTIDs for the transactions that were executed on the source
            server, so that the target server records these transactions
            as applied, although it does not have them in its binary
            logs. <code class="option">--set-gtid-purged</code> also controls the
            inclusion of a <code class="literal">SET
            @@SESSION.sql_log_bin=0</code> statement, which disables
            binary logging while the dump file is being reloaded. This
            statement prevents new GTIDs from being generated and
            assigned to the transactions in the dump file as they are
            executed, so that the original GTIDs for the transactions
            are used.
          </p><p>
            If you do not set the <code class="option">--set-gtid-purged</code>
            option, the default is that a <code class="literal">SET
            @@GLOBAL.gtid_purged</code> statement is included in the
            dump output if GTIDs are enabled on the server you are
            backing up, and the set of GTIDs in the global value of the
            <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> system
            variable is not empty. A <code class="literal">SET
            @@SESSION.sql_log_bin=0</code> statement is also included
            if GTIDs are enabled on the server.
          </p><p>
            In MySQL 5.6 and 5.7, you can replace the value of
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> with a
            specified GTID set, provided that
            <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> and
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> are empty. From
            MySQL 8.0, you can either replace the value of
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> with a
            specified GTID set, or you can add a plus sign (+) to the
            statement to append a specified GTID set to the GTID set
            that is already held by
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a>.
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>'s <code class="literal">SET
            @@GLOBAL.gtid_purged</code> statement includes a plus
            sign (+) in a version comment that takes effect when the
            dump file is replayed on releases from MySQL 8.0, meaning
            that for these releases, the GTID set from the dump file is
            added to the existing
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> value. For
            MySQL 5.6 and 5.7, the value of
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> is replaced
            with the GTID set from the dump file, which can only happen
            when <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> is the
            empty set (so when replication has not been started
            previously, or when replication was not previously using
            GTIDs). For the exact details of how the <code class="literal">SET
            @@GLOBAL.gtid_purged</code> statement operates, see the
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> description for
            the release where the dump file is to be replayed.
          </p><p>
            It is important to note that the value that is included by
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> for the <code class="literal">SET
            @@GLOBAL.gtid_purged</code> statement includes the GTIDs
            of all transactions in the
            <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> set on the
            server, even those that changed suppressed parts of the
            database, or other databases on the server that were not
            included in a partial dump. This can mean that after the
            <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> value has been
            updated on the server where the dump file is replayed, GTIDs
            are present that do not relate to any data on the target
            server. If you do not replay any further dump files on the
            target server, the extraneous GTIDs do not cause any
            problems with the future operation of the server, but they
            make it harder to compare or reconcile GTID sets on
            different servers in the replication topology. If you do
            replay a further dump file on the target server that
            contains the same GTIDs (for example, another partial dump
            from the same origin server), any <code class="literal">SET
            @@GLOBAL.gtid_purged</code> statement in the second dump
            file fails. In this case, either remove the statement
            manually before replaying the dump file, or output the dump
            file without the statement.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              For MySQL 5.6 and 5.7, it is not recommended to load a
              dump file when GTIDs are enabled on the server
              (<a class="link" href="replication.html#sysvar_gtid_mode"><code class="literal">gtid_mode=ON</code></a>), if your
              dump file includes system tables.
              <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> issues DML instructions for
              the system tables which use the non-transactional MyISAM
              storage engine, and this combination is not permitted when
              GTIDs are enabled.
</p>
</div>
<p>
            If the <code class="literal">SET @@GLOBAL.gtid_purged</code> statement
            would not have the desired result on your target server, you
            can exclude the statement from the output, or (from MySQL
            8.0.17) include it but comment it out so that it is not
            actioned automatically. You can also include the statement
            but manually edit it in the dump file to achieve the desired
            result.
          </p><p>
            The possible values for the
            <code class="option">--set-gtid-purged</code> option are as follows:
</p>
<div class="variablelist">
<dl class="variablelist"><dt><span class="term">
                <code class="literal">AUTO</code>
              </span></dt><dd><p>
                  The default value. If GTIDs are enabled on the server
                  you are backing up and
                  <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> is not
                  empty, <code class="literal">SET @@GLOBAL.gtid_purged</code> is
                  added to the output, containing the GTID set from
                  <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a>. If
                  GTIDs are enabled, <code class="literal">SET
                  @@SESSION.sql_log_bin=0</code> is added to the
                  output. If GTIDs are not enabled on the server, the
                  statements are not added to the output.
                </p></dd><dt><span class="term">
                <code class="literal">OFF</code>
              </span></dt><dd><p>
                  <code class="literal">SET @@GLOBAL.gtid_purged</code> is not
                  added to the output, and <code class="literal">SET
                  @@SESSION.sql_log_bin=0</code> is not added to the
                  output. For a server where GTIDs are not in use, use
                  this option or <code class="literal">AUTO</code>. Only use this
                  option for a server where GTIDs are in use if you are
                  sure that the required GTID set is already present in
                  <a class="link" href="replication.html#sysvar_gtid_purged"><code class="literal">gtid_purged</code></a> on the
                  target server and should not be changed, or if you
                  plan to identify and add any missing GTIDs manually.
                </p></dd><dt><span class="term">
                <code class="literal">ON</code>
              </span></dt><dd><p>
                  If GTIDs are enabled on the server you are backing up,
                  <code class="literal">SET @@GLOBAL.gtid_purged</code> is added
                  to the output (unless
                  <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> is
                  empty), and <code class="literal">SET
                  @@SESSION.sql_log_bin=0</code> is added to the
                  output. An error occurs if you set this option but
                  GTIDs are not enabled on the server. For a server
                  where GTIDs are in use, use this option or
                  <code class="literal">AUTO</code>, unless you are sure that the
                  GTIDs in
                  <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> are not
                  needed on the target server.
                </p></dd><dt><span class="term">
                <code class="literal">COMMENTED</code>
              </span></dt><dd><p>
                  Available from MySQL 8.0.17. If GTIDs are enabled on
                  the server you are backing up, <code class="literal">SET
                  @@GLOBAL.gtid_purged</code> is added to the output
                  (unless <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a>
                  is empty), but it is commented out. This means that
                  the value of
                  <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a> is
                  available in the output, but no action is taken
                  automatically when the dump file is reloaded.
                  <code class="literal">SET @@SESSION.sql_log_bin=0</code> is
                  added to the output, and it is not commented out. With
                  <code class="literal">COMMENTED</code>, you can control the use
                  of the <a class="link" href="replication.html#sysvar_gtid_executed"><code class="literal">gtid_executed</code></a>
                  set manually or through automation. For example, you
                  might prefer to do this if you are migrating data to
                  another server that already has different active
                  databases.
</p></dd></dl>
</div>
</li></ul>
</div>
<h4><a name="mysqldump-format-options"></a>Format Options</h4>
<p>
        The following options specify how to represent the entire dump
        file or certain kinds of data in the dump file. They also
        control whether certain optional information is written to the
        dump file.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_compact"></a>
            <a class="indexterm" name="idm46444425964032"></a>

            <a class="indexterm" name="idm46444425962640"></a>

            <code class="option">--compact</code>
          </p><p>
            Produce more compact output. This option enables the
            <a class="link" href="programs.html#option_mysqldump_add-drop-table"><code class="option">--skip-add-drop-table</code></a>,
            <a class="link" href="programs.html#option_mysqldump_add-locks"><code class="option">--skip-add-locks</code></a>,
            <a class="link" href="programs.html#option_mysqldump_skip-comments"><code class="option">--skip-comments</code></a>,
            <a class="link" href="programs.html#option_mysqldump_disable-keys"><code class="option">--skip-disable-keys</code></a>,
            and
            <a class="link" href="programs.html#option_mysqldump_set-charset"><code class="option">--skip-set-charset</code></a>
            options.
          </p></li><li class="listitem"><p><a name="option_mysqldump_compatible"></a>
            <a class="indexterm" name="idm46444425955616"></a>

            <a class="indexterm" name="idm46444425954224"></a>

            <code class="option">--compatible=<em class="replaceable"><code>name</code></em></code>
          </p><p>
            Produce output that is more compatible with other database
            systems or with older MySQL servers. The only permitted
            value for this option is <code class="literal">ansi</code>, which has
            the same meaning as the corresponding option for setting the
            server SQL mode. See <a class="xref" href="server-administration.html#sql-mode" title="5.1.11 Server SQL Modes">Section 5.1.11, “Server SQL Modes”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_complete-insert"></a>
            <a class="indexterm" name="idm46444425949360"></a>

            <a class="indexterm" name="idm46444425947968"></a>

            <code class="option">--complete-insert</code>, <code class="option">-c</code>
          </p><p>
            Use complete <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements that include column names.
          </p></li><li class="listitem"><p><a name="option_mysqldump_create-options"></a>
            <a class="indexterm" name="idm46444425943344"></a>

            <a class="indexterm" name="idm46444425941952"></a>

            <code class="option">--create-options</code>
          </p><p>
            Include all MySQL-specific table options in the
            <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a> statements.
          </p></li><li class="listitem"><p><a name="option_mysqldump_fields"></a>
            <a class="indexterm" name="idm46444425937696"></a>

            <a class="indexterm" name="idm46444425936304"></a>

            <code class="option">--fields-terminated-by=...</code>,

            <a class="indexterm" name="idm46444425934288"></a>

            <a class="indexterm" name="idm46444425932896"></a>

            <code class="option">--fields-enclosed-by=...</code>,

            <a class="indexterm" name="idm46444425930880"></a>

            <a class="indexterm" name="idm46444425929488"></a>

            <code class="option">--fields-optionally-enclosed-by=...</code>,

            <a class="indexterm" name="idm46444425927472"></a>

            <a class="indexterm" name="idm46444425926080"></a>

            <code class="option">--fields-escaped-by=...</code>
          </p><p>
            These options are used with the
            <a class="link" href="programs.html#option_mysqldump_tab"><code class="option">--tab</code></a> option and have the
            same meaning as the corresponding <code class="literal">FIELDS</code>
            clauses for <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>. See
            <a class="xref" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement">Section 13.2.7, “LOAD DATA Statement”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_hex-blob"></a>
            <a class="indexterm" name="idm46444425919648"></a>

            <a class="indexterm" name="idm46444425918256"></a>

            <code class="option">--hex-blob</code>
          </p><p>
            Dump binary columns using hexadecimal notation (for example,
            <code class="literal">'abc'</code> becomes
            <code class="literal">0x616263</code>). The affected data types are
            <a class="link" href="data-types.html#binary-varbinary" title="11.3.3 The BINARY and VARBINARY Types"><code class="literal">BINARY</code></a>,
            <a class="link" href="data-types.html#binary-varbinary" title="11.3.3 The BINARY and VARBINARY Types"><code class="literal">VARBINARY</code></a>,
            <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> types,
            <a class="link" href="data-types.html#bit-type" title="11.1.5 Bit-Value Type - BIT"><code class="literal">BIT</code></a>, all spatial data types,
            and other non-binary data types when used with the
            <a class="link" href="charset.html#charset-binary-set" title="10.10.8 The Binary Character Set"><code class="literal">binary</code>
            character set</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_lines-terminated-by"></a>
            <a class="indexterm" name="idm46444425908544"></a>

            <a class="indexterm" name="idm46444425907152"></a>

            <code class="option">--lines-terminated-by=...</code>
          </p><p>
            This option is used with the
            <a class="link" href="programs.html#option_mysqldump_tab"><code class="option">--tab</code></a> option and has the
            same meaning as the corresponding <code class="literal">LINES</code>
            clause for <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>. See
            <a class="xref" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement">Section 13.2.7, “LOAD DATA Statement”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_quote-names"></a>
            <a class="indexterm" name="idm46444425901040"></a>

            <a class="indexterm" name="idm46444425899648"></a>

            <code class="option">--quote-names</code>, <code class="option">-Q</code>
          </p><p>
            Quote identifiers (such as database, table, and column
            names) within <code class="literal">`</code> characters. If the
            <a class="link" href="server-administration.html#sqlmode_ansi_quotes"><code class="literal">ANSI_QUOTES</code></a> SQL mode is
            enabled, identifiers are quoted within <code class="literal">"</code>
            characters. This option is enabled by default. It can be
            disabled with <code class="option">--skip-quote-names</code>, but this
            option should be given after any option such as
            <a class="link" href="programs.html#option_mysqldump_compatible"><code class="option">--compatible</code></a> that may
            enable <a class="link" href="programs.html#option_mysqldump_quote-names"><code class="option">--quote-names</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_result-file"></a>
            <a class="indexterm" name="idm46444425891568"></a>

            <a class="indexterm" name="idm46444425890176"></a>

            <code class="option">--result-file=<em class="replaceable"><code>file_name</code></em></code>,
            <code class="option">-r <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            Direct output to the named file. The result file is created
            and its previous contents overwritten, even if an error
            occurs while generating the dump.
          </p><p>
            This option should be used on Windows to prevent newline
            <code class="literal">\n</code> characters from being converted to
            <code class="literal">\r\n</code> carriage return/newline sequences.
          </p></li><li class="listitem"><p><a name="option_mysqldump_show-create-skip-secondary-engine"></a>
            <a class="link" href="programs.html#option_mysqldump_show-create-skip-secondary-engine"><code class="option">--show-create-skip-secondary-engine=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444425883040"></a><a class="indexterm" name="idm46444425881648"></a><p>
            Excludes the <code class="literal">SECONDARY ENGINE</code> clause from
            <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a> statements. It
            does so by enabling the
            <a class="link" href="server-administration.html#sysvar_show_create_table_skip_secondary_engine"><code class="literal">show_create_table_skip_secondary_engine</code></a>
            system variable for the duration of the dump operation.
            Alternatively, you can enable the
            <a class="link" href="server-administration.html#sysvar_show_create_table_skip_secondary_engine"><code class="literal">show_create_table_skip_secondary_engine</code></a>
            system variable prior to using <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>.
          </p><p>
            This option was added in MySQL 8.0.18. Attempting a
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> operation with the
            <a class="link" href="programs.html#option_mysqldump_show-create-skip-secondary-engine"><code class="option">--show-create-skip-secondary-engine</code></a>
            option on a release prior to MySQL 8.0.18 that does not
            support the
            <a class="link" href="server-administration.html#sysvar_show_create_table_skip_secondary_engine"><code class="literal">show_create_table_skip_secondary_engine</code></a>
            variable causes an error.
          </p></li><li class="listitem"><p><a name="option_mysqldump_tab"></a>
            <a class="indexterm" name="idm46444425870832"></a>

            <a class="indexterm" name="idm46444425869440"></a>

            <code class="option">--tab=<em class="replaceable"><code>dir_name</code></em></code>,
            <code class="option">-T <em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            Produce tab-separated text-format data files. For each
            dumped table, <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> creates a
            <code class="filename"><em class="replaceable"><code>tbl_name</code></em>.sql</code>
            file that contains the <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE
            TABLE</code></a> statement that creates the table, and the
            server writes a
            <code class="filename"><em class="replaceable"><code>tbl_name</code></em>.txt</code>
            file that contains its data. The option value is the
            directory in which to write the files.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              This option should be used only when
              <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> is run on the same machine as
              the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server. Because the server
              creates <code class="filename">*.txt</code> files in the directory
              that you specify, the directory must be writable by the
              server and the MySQL account that you use must have the
              <a class="link" href="security.html#priv_file"><code class="literal">FILE</code></a> privilege. Because
              <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> creates
              <code class="filename">*.sql</code> in the same directory, it must
              be writable by your system login account.
</p>
</div>
<p>
            By default, the <code class="filename">.txt</code> data files are
            formatted using tab characters between column values and a
            newline at the end of each line. The format can be specified
            explicitly using the
            <code class="option">--fields-<em class="replaceable"><code>xxx</code></em></code> and
            <a class="link" href="programs.html#option_mysqldump_lines-terminated-by"><code class="option">--lines-terminated-by</code></a>
            options.
          </p><p>
            Column values are converted to the character set specified
            by the
            <a class="link" href="programs.html#option_mysqldump_default-character-set"><code class="option">--default-character-set</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqldump_tz-utc"></a>
            <a class="indexterm" name="idm46444425851040"></a>

            <a class="indexterm" name="idm46444425849648"></a>

            <code class="option">--tz-utc</code>
          </p><p>
            This option enables <a class="link" href="data-types.html#datetime" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a>
            columns to be dumped and reloaded between servers in
            different time zones. <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> sets its
            connection time zone to UTC and adds <code class="literal">SET
            TIME_ZONE='+00:00'</code> to the dump file. Without this
            option, <a class="link" href="data-types.html#datetime" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> columns are
            dumped and reloaded in the time zones local to the source
            and destination servers, which can cause the values to
            change if the servers are in different time zones.
            <code class="option">--tz-utc</code> also protects against changes due
            to daylight saving time. <code class="option">--tz-utc</code> is
            enabled by default. To disable it, use
            <code class="option">--skip-tz-utc</code>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_xml"></a>
            <a class="indexterm" name="idm46444425841120"></a>

            <a class="indexterm" name="idm46444425839728"></a>

            <code class="option">--xml</code>, <code class="option">-X</code>
          </p><p>
            Write dump output as well-formed XML.
          </p><p>
            <span class="bold"><strong><code class="literal">NULL</code>,
            <code class="literal">'NULL'</code>, and Empty Values</strong></span>: For
            a column named <em class="replaceable"><code>column_name</code></em>, the
            <code class="literal">NULL</code> value, an empty string, and the
            string value <code class="literal">'NULL'</code> are distinguished
            from one another in the output generated by this option as
            follows.
</p>
<div class="informaltable">
<table summary="For a column named column_name, the NULL value, an empty string, and the string value 'NULL' are distinguished from one another in the XML output generated by the mysqldump --xml, -X option, as shown in this table."><col width="50%"><col width="50%"><thead><tr>
                <th scope="col">Value:</th>
                <th scope="col">XML Representation:</th>
              </tr></thead><tbody><tr>
                <td scope="row"><code class="literal">NULL</code> (<span class="emphasis"><em>unknown value</em></span>)</td>
                <td><p>
                    <code class="literal">&lt;field
                    name="<em class="replaceable"><code>column_name</code></em>"
                    xsi:nil="true" /&gt;</code>
                  </p></td>
              </tr><tr>
                <td scope="row"><code class="literal">''</code> (<span class="emphasis"><em>empty string</em></span>)</td>
                <td><p>
                    <code class="literal">&lt;field
                    name="<em class="replaceable"><code>column_name</code></em>"&gt;&lt;/field&gt;</code>
                  </p></td>
              </tr><tr>
                <td scope="row"><code class="literal">'NULL'</code> (<span class="emphasis"><em>string value</em></span>)</td>
                <td><p>
                    <code class="literal">&lt;field
                    name="<em class="replaceable"><code>column_name</code></em>"&gt;NULL&lt;/field&gt;</code>
                  </p></td>
</tr></tbody></table>
</div>
<p>
            The output from the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client when run
            using the <a class="link" href="programs.html#option_mysql_xml"><code class="option">--xml</code></a> option also
            follows the preceding rules. (See
            <a class="xref" href="programs.html#mysql-command-options" title="4.5.1.1 mysql Client Options">Section 4.5.1.1, “mysql Client Options”</a>.)
          </p><p>
            XML output from <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> includes the
            XML namespace, as shown here:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --xml -u root world City</code></strong>
&lt;?xml version="1.0"?&gt;
&lt;mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;database name="world"&gt;
&lt;table_structure name="City"&gt;
&lt;field Field="ID" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" /&gt;
&lt;field Field="Name" Type="char(35)" Null="NO" Key="" Default="" Extra="" /&gt;
&lt;field Field="CountryCode" Type="char(3)" Null="NO" Key="" Default="" Extra="" /&gt;
&lt;field Field="District" Type="char(20)" Null="NO" Key="" Default="" Extra="" /&gt;
&lt;field Field="Population" Type="int(11)" Null="NO" Key="" Default="0" Extra="" /&gt;
&lt;key Table="City" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="ID"
Collation="A" Cardinality="4079" Null="" Index_type="BTREE" Comment="" /&gt;
&lt;options Name="City" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="4079"
Avg_row_length="67" Data_length="273293" Max_data_length="18858823439613951"
Index_length="43008" Data_free="0" Auto_increment="4080"
Create_time="2007-03-31 01:47:01" Update_time="2007-03-31 01:47:02"
Collation="latin1_swedish_ci" Create_options="" Comment="" /&gt;
&lt;/table_structure&gt;
&lt;table_data name="City"&gt;
&lt;row&gt;
&lt;field name="ID"&gt;1&lt;/field&gt;
&lt;field name="Name"&gt;Kabul&lt;/field&gt;
&lt;field name="CountryCode"&gt;AFG&lt;/field&gt;
&lt;field name="District"&gt;Kabol&lt;/field&gt;
&lt;field name="Population"&gt;1780000&lt;/field&gt;
&lt;/row&gt;

<em class="replaceable"><code>...</code></em>

&lt;row&gt;
&lt;field name="ID"&gt;4079&lt;/field&gt;
&lt;field name="Name"&gt;Rafah&lt;/field&gt;
&lt;field name="CountryCode"&gt;PSE&lt;/field&gt;
&lt;field name="District"&gt;Rafah&lt;/field&gt;
&lt;field name="Population"&gt;92020&lt;/field&gt;
&lt;/row&gt;
&lt;/table_data&gt;
&lt;/database&gt;
&lt;/mysqldump&gt;
</pre></li></ul>
</div>
<h4><a name="mysqldump-filter-options"></a>Filtering Options</h4>
<p>
        The following options control which kinds of schema objects are
        written to the dump file: by category, such as triggers or
        events; by name, for example, choosing which databases and
        tables to dump; or even filtering rows from the table data using
        a <code class="literal">WHERE</code> clause.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_all-databases"></a>
            <a class="indexterm" name="idm46444425802560"></a>

            <a class="indexterm" name="idm46444425801168"></a>

            <code class="option">--all-databases</code>, <code class="option">-A</code>
          </p><p>
            Dump all tables in all databases. This is the same as using
            the <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> option and
            naming all the databases on the command line.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              See the
              <a class="link" href="programs.html#option_mysqldump_add-drop-database"><code class="option">--add-drop-database</code></a>
              description for information about an incompatibility of
              that option with
              <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a>.
</p>
</div>
<p>
            Prior to MySQL 8.0, the
            <a class="link" href="programs.html#option_mysqldump_routines"><code class="option">--routines</code></a> and
            <a class="link" href="programs.html#option_mysqldump_events"><code class="option">--events</code></a> options for
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> and
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> were not required to include
            stored routines and events when using the
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option:
            The dump included the <code class="literal">mysql</code> system
            database, and therefore also the
            <code class="literal">mysql.proc</code> and
            <code class="literal">mysql.event</code> tables containing stored
            routine and event definitions. As of MySQL 8.0,
            the <code class="literal">mysql.event</code> and
            <code class="literal">mysql.proc</code> tables are not used.
            Definitions for the corresponding objects are stored in data
            dictionary tables, but those tables are not dumped. To
            include stored routines and events in a dump made using
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a>, use the
            <a class="link" href="programs.html#option_mysqldump_routines"><code class="option">--routines</code></a> and
            <a class="link" href="programs.html#option_mysqldump_events"><code class="option">--events</code></a> options
            explicitly.
          </p></li><li class="listitem"><p><a name="option_mysqldump_databases"></a>
            <a class="indexterm" name="idm46444425783696"></a>

            <a class="indexterm" name="idm46444425782304"></a>

            <code class="option">--databases</code>, <code class="option">-B</code>
          </p><p>
            Dump several databases. Normally,
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> treats the first name argument
            on the command line as a database name and following names
            as table names. With this option, it treats all name
            arguments as database names. <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE
            DATABASE</code></a> and <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a>
            statements are included in the output before each new
            database.
          </p><p>
            This option may be used to dump the
            <code class="literal">performance_schema</code> database, which
            normally is not dumped even with the
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option.
            (Also use the
            <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--skip-lock-tables</code></a>
            option.)
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              See the
              <a class="link" href="programs.html#option_mysqldump_add-drop-database"><code class="option">--add-drop-database</code></a>
              description for information about an incompatibility of
              that option with
              <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a>.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqldump_events"></a>
            <a class="indexterm" name="idm46444425770272"></a>

            <a class="indexterm" name="idm46444425768880"></a>

            <code class="option">--events</code>, <code class="option">-E</code>
          </p><p>
            Include Event Scheduler events for the dumped databases in
            the output. This option requires the
            <a class="link" href="security.html#priv_event"><code class="literal">EVENT</code></a> privileges for those
            databases.
          </p><p>
            The output generated by using <code class="option">--events</code>
            contains <a class="link" href="sql-statements.html#create-event" title="13.1.13 CREATE EVENT Statement"><code class="literal">CREATE EVENT</code></a>
            statements to create the events.
          </p></li><li class="listitem"><p><a name="option_mysqldump_ignore-error"></a>
            <a class="indexterm" name="idm46444425761520"></a>

            <a class="indexterm" name="idm46444425760032"></a>

            <code class="option">--ignore-error=<em class="replaceable"><code>error[,error]...</code></em></code>
          </p><p>
            Ignore the specified errors. The option value is a list of
            comma-separated error numbers specifying the errors to
            ignore during <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> execution. If the
            <a class="link" href="programs.html#option_mysqldump_force"><code class="option">--force</code></a> option is also
            given to ignore all errors,
            <a class="link" href="programs.html#option_mysqldump_force"><code class="option">--force</code></a> takes precedence.
          </p></li><li class="listitem"><p><a name="option_mysqldump_ignore-table"></a>
            <a class="indexterm" name="idm46444425752944"></a>

            <a class="indexterm" name="idm46444425751456"></a>

            <code class="option">--ignore-table=<em class="replaceable"><code>db_name.tbl_name</code></em></code>
          </p><p>
            Do not dump the given table, which must be specified using
            both the database and table names. To ignore multiple
            tables, use this option multiple times. This option also can
            be used to ignore views.
          </p></li><li class="listitem"><p><a name="option_mysqldump_no-data"></a>
            <a class="indexterm" name="idm46444425747504"></a>

            <a class="indexterm" name="idm46444425746016"></a>

            <code class="option">--no-data</code>, <code class="option">-d</code>
          </p><p>
            Do not write any table row information (that is, do not dump
            table contents). This is useful if you want to dump only the
            <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a> statement for
            the table (for example, to create an empty copy of the table
            by loading the dump file).
          </p></li><li class="listitem"><p><a name="option_mysqldump_routines"></a>
            <a class="indexterm" name="idm46444425740704"></a>

            <a class="indexterm" name="idm46444425739216"></a>

            <code class="option">--routines</code>, <code class="option">-R</code>
          </p><p>
            Include stored routines (procedures and functions) for the
            dumped databases in the output. This option requires the
            global <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> privilege.
          </p><p>
            The output generated by using <code class="option">--routines</code>
            contains <a class="link" href="sql-statements.html#create-procedure" title="13.1.17 CREATE PROCEDURE and CREATE FUNCTION Statements"><code class="literal">CREATE PROCEDURE</code></a> and
            <a class="link" href="sql-statements.html#create-function" title="13.1.14 CREATE FUNCTION Statement"><code class="literal">CREATE FUNCTION</code></a> statements to
            create the routines.
          </p></li><li class="listitem"><p><a name="option_mysqldump_tables"></a>
            <a class="indexterm" name="idm46444425730624"></a>

            <a class="indexterm" name="idm46444425729168"></a>

            <code class="option">--tables</code>
          </p><p>
            Override the <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a>
            or <code class="option">-B</code> option. <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>
            regards all name arguments following the option as table
            names.
          </p></li><li class="listitem"><p><a name="option_mysqldump_triggers"></a>
            <a class="indexterm" name="idm46444425722896"></a>

            <a class="indexterm" name="idm46444425721408"></a>

            <code class="option">--triggers</code>
          </p><p>
            Include triggers for each dumped table in the output. This
            option is enabled by default; disable it with
            <code class="option">--skip-triggers</code>.
          </p><p>
            To be able to dump a table's triggers, you must have the
            <a class="link" href="security.html#priv_trigger"><code class="literal">TRIGGER</code></a> privilege for the
            table.
          </p><p>
            Multiple triggers are permitted.
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> dumps triggers in activation
            order so that when the dump file is reloaded, triggers are
            created in the same activation order. However, if a
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> dump file contains multiple
            triggers for a table that have the same trigger event and
            action time, an error occurs for attempts to load the dump
            file into an older server that does not support multiple
            triggers. (For a workaround, see
            <a class="ulink" href="https://dev.mysql.com/doc/refman/5.7/en/downgrading-to-previous-series.html" target="_top">Downgrade Notes</a>;
            you can convert triggers to be compatible with older
            servers.)
          </p></li><li class="listitem"><p><a name="option_mysqldump_where"></a>
            <a class="indexterm" name="idm46444425711408"></a>

            <a class="indexterm" name="idm46444425709952"></a>

            <code class="option">--where='<em class="replaceable"><code>where_condition</code></em>'</code>,
            <code class="option">-w
            '<em class="replaceable"><code>where_condition</code></em>'</code>
          </p><p>
            Dump only rows selected by the given
            <code class="literal">WHERE</code> condition. Quotes around the
            condition are mandatory if it contains spaces or other
            characters that are special to your command interpreter.

            
          </p><p>
            Examples:
          </p><pre data-lang="terminal" class="programlisting">--where="user='jimf'"
-w"userid&gt;1"
-w"userid&lt;1"</pre></li></ul>
</div>
<h4><a name="mysqldump-performance-options"></a>Performance Options</h4>
<p>
        The following options are the most relevant for the performance
        particularly of the restore operations. For large data sets,
        restore operation (processing the <code class="literal">INSERT</code>
        statements in the dump file) is the most time-consuming part.
        When it is urgent to restore data quickly, plan and test the
        performance of this stage in advance. For restore times measured
        in hours, you might prefer an alternative backup and restore
        solution, such as <a class="link" href="mysql-enterprise.html#mysql-enterprise-backup" title="30.2 MySQL Enterprise Backup Overview">MySQL
        Enterprise Backup</a> for <code class="literal">InnoDB</code>-only and
        mixed-use databases.

        
      </p><p>
        Performance is also affected by the
        <a class="link" href="programs.html#mysqldump-transaction-options" title="Transactional Options">transactional
        options</a>, primarily for the dump operation.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_column-statistics"></a>
            <a class="link" href="programs.html#option_mysqldump_column-statistics"><code class="option">--column-statistics</code></a>
          </p><a class="indexterm" name="idm46444425693888"></a><a class="indexterm" name="idm46444425692432"></a><p>
            Add <a class="link" href="sql-statements.html#analyze-table" title="13.7.3.1 ANALYZE TABLE Statement"><code class="literal">ANALYZE TABLE</code></a> statements
            to the output to generate histogram statistics for dumped
            tables when the dump file is reloaded. This option is
            disabled by default because histogram generation for large
            tables can take a long time.
          </p></li><li class="listitem"><p><a name="option_mysqldump_disable-keys"></a>
            <a class="indexterm" name="idm46444425687936"></a>

            <a class="indexterm" name="idm46444425686448"></a>

            <code class="option">--disable-keys</code>, <code class="option">-K</code>
          </p><p>
            For each table, surround the
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements with
            <code class="literal">/*!40000 ALTER TABLE
            <em class="replaceable"><code>tbl_name</code></em> DISABLE KEYS
            */;</code> and <code class="literal">/*!40000 ALTER TABLE
            <em class="replaceable"><code>tbl_name</code></em> ENABLE KEYS
            */;</code> statements. This makes loading the dump file
            faster because the indexes are created after all rows are
            inserted. This option is effective only for nonunique
            indexes of <code class="literal">MyISAM</code> tables.
          </p></li><li class="listitem"><p><a name="option_mysqldump_extended-insert"></a>
            <a class="indexterm" name="idm46444425677984"></a>

            <a class="indexterm" name="idm46444425676496"></a>

            <code class="option">--extended-insert</code>, <code class="option">-e</code>
          </p><p>
            Write <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements using
            multiple-row syntax that includes several
            <code class="literal">VALUES</code> lists. This results in a smaller
            dump file and speeds up inserts when the file is reloaded.
          </p></li><li class="listitem"><p><a name="option_mysqldump_insert-ignore"></a>
            <a class="indexterm" name="idm46444425670512"></a>

            <a class="indexterm" name="idm46444425669024"></a>

            <code class="option">--insert-ignore</code>
          </p><p>
            Write <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT
            IGNORE</code></a> statements rather than
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements.
          </p></li><li class="listitem"><p><a name="option_mysqldump_max-allowed-packet"></a>
            <a class="link" href="programs.html#option_mysqldump_max-allowed-packet"><code class="option">--max-allowed-packet=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444425661600"></a><a class="indexterm" name="idm46444425660144"></a><p>
            The maximum size of the buffer for client/server
            communication. The default is 24MB, the maximum is 1GB.
          </p></li><li class="listitem"><p><a name="option_mysqldump_net-buffer-length"></a>
            <a class="link" href="programs.html#option_mysqldump_net-buffer-length"><code class="option">--net-buffer-length=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444425655568"></a><a class="indexterm" name="idm46444425654112"></a><p>
            The initial size of the buffer for client/server
            communication. When creating multiple-row
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements (as with
            the <a class="link" href="programs.html#option_mysqldump_extended-insert"><code class="option">--extended-insert</code></a> or
            <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> option),
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> creates rows up to
            <a class="link" href="programs.html#option_mysqldump_net-buffer-length"><code class="option">--net-buffer-length</code></a> bytes
            long. If you increase this variable, ensure that the MySQL
            server <a class="link" href="server-administration.html#sysvar_net_buffer_length"><code class="literal">net_buffer_length</code></a>
            system variable has a value at least this large.
          </p></li><li class="listitem"><p><a name="option_mysqldump_network-timeout"></a>
            <a class="indexterm" name="idm46444425643968"></a>

            <a class="indexterm" name="idm46444425642480"></a>

            <a class="link" href="programs.html#option_mysqldump_network-timeout"><code class="option">--network-timeout</code></a>,
            <code class="option">-M</code>
          </p><p>
            Enable large tables to be dumped by setting
            <a class="link" href="programs.html#option_mysqldump_max-allowed-packet"><code class="option">--max-allowed-packet</code></a> to
            its maximum value and network read and write timeouts to a
            large value. This option is enabled by default. To disable
            it, use
            <a class="link" href="programs.html#option_mysqldump_network-timeout"><code class="option">--skip-network-timeout</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_opt"></a>
            <a class="indexterm" name="idm46444425635728"></a>

            <a class="indexterm" name="idm46444425634272"></a>

            <code class="option">--opt</code>
          </p><p>
            This option, enabled by default, is shorthand for the
            combination of
            <a class="link" href="programs.html#option_mysqldump_add-drop-table"><code class="option">--add-drop-table</code></a>
            <a class="link" href="programs.html#option_mysqldump_add-locks"><code class="option">--add-locks</code></a>
            <a class="link" href="programs.html#option_mysqldump_create-options"><code class="option">--create-options</code></a>
            <a class="link" href="programs.html#option_mysqldump_disable-keys"><code class="option">--disable-keys</code></a>
            <a class="link" href="programs.html#option_mysqldump_extended-insert"><code class="option">--extended-insert</code></a>
            <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a>
            <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--quick</code></a>
            <a class="link" href="programs.html#option_mysqldump_set-charset"><code class="option">--set-charset</code></a>. It gives a
            fast dump operation and produces a dump file that can be
            reloaded into a MySQL server quickly.
          </p><p>
            Because the <code class="option">--opt</code> option is enabled by
            default, you only specify its converse, the
            <a class="link" href="programs.html#option_mysqldump_skip-opt"><code class="option">--skip-opt</code></a> to turn off
            several default settings. See the discussion of
            <a class="link" href="programs.html#mysqldump-option-groups" title="Option Groups"><code class="literal">mysqldump</code>
            option groups</a> for information about selectively
            enabling or disabling a subset of the options affected by
            <code class="option">--opt</code>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_quick"></a>
            <a class="indexterm" name="idm46444425618896"></a>

            <a class="indexterm" name="idm46444425617440"></a>

            <code class="option">--quick</code>, <code class="option">-q</code>
          </p><p>
            This option is useful for dumping large tables. It forces
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to retrieve rows for a table
            from the server a row at a time rather than retrieving the
            entire row set and buffering it in memory before writing it
            out.
          </p></li><li class="listitem"><p><a name="option_mysqldump_skip-opt"></a>
            <a class="indexterm" name="idm46444425612032"></a>

            <a class="indexterm" name="idm46444425610544"></a>

            <code class="option">--skip-opt</code>
          </p><p>
            See the description for the
            <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> option.

            
</p></li></ul>
</div>
<h4><a name="mysqldump-transaction-options"></a>Transactional Options</h4>
<p>
        The following options trade off the performance of the dump
        operation, against the reliability and consistency of the
        exported data.

        
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldump_add-locks"></a>
            <a class="indexterm" name="idm46444425602416"></a>

            <a class="indexterm" name="idm46444425600928"></a>

            <code class="option">--add-locks</code>
          </p><p>
            Surround each table dump with <a class="link" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements"><code class="literal">LOCK
            TABLES</code></a> and
            <a class="link" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements"><code class="literal">UNLOCK
            TABLES</code></a> statements. This results in faster inserts
            when the dump file is reloaded. See
            <a class="xref" href="optimization.html#insert-optimization" title="8.2.5.1 Optimizing INSERT Statements">Section 8.2.5.1, “Optimizing INSERT Statements”</a>.

            
          </p></li><li class="listitem"><p><a name="option_mysqldump_flush-logs"></a>
            <a class="indexterm" name="idm46444425593296"></a>

            <a class="indexterm" name="idm46444425591808"></a>

            <code class="option">--flush-logs</code>, <code class="option">-F</code>
          </p><p>
            Flush the MySQL server log files before starting the dump.
            This option requires the
            <a class="link" href="security.html#priv_reload"><code class="literal">RELOAD</code></a> privilege. If you use
            this option in combination with the
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option,
            the logs are flushed <span class="emphasis"><em>for each database
            dumped</em></span>. The exception is when using
            <a class="link" href="programs.html#option_mysqldump_lock-all-tables"><code class="option">--lock-all-tables</code></a>,
            <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a>, or
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a>: In
            this case, the logs are flushed only once, corresponding to
            the moment that all tables are locked by
            <a class="link" href="sql-statements.html#flush-tables-with-read-lock"><code class="literal">FLUSH TABLES WITH READ LOCK</code></a>.
            If you want your dump and the log flush to happen at exactly
            the same moment, you should use
            <code class="option">--flush-logs</code> together with
            <a class="link" href="programs.html#option_mysqldump_lock-all-tables"><code class="option">--lock-all-tables</code></a>,
            <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a>, or
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_flush-privileges"></a>
            <a class="indexterm" name="idm46444425576960"></a>

            <a class="indexterm" name="idm46444425575472"></a>

            <code class="option">--flush-privileges</code>
          </p><p>
            Add a <a class="link" href="sql-statements.html#flush-privileges"><code class="literal">FLUSH PRIVILEGES</code></a>
            statement to the dump output after dumping the
            <code class="literal">mysql</code> database. This option should be
            used any time the dump contains the <code class="literal">mysql</code>
            database and any other database that depends on the data in
            the <code class="literal">mysql</code> database for proper
            restoration.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              For upgrades to MySQL 5.7.2 or higher from older versions,
              do not use <code class="option">--flush-privileges</code>. For
              upgrade instructions in this case, see
              <a class="xref" href="installing.html#upgrading-from-previous-series" title="2.11.4 Changes in MySQL 8.0">Section 2.11.4, “Changes in MySQL 8.0”</a>.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqldump_lock-all-tables"></a>
            <a class="indexterm" name="idm46444425565504"></a>

            <a class="indexterm" name="idm46444425564016"></a>

            <code class="option">--lock-all-tables</code>, <code class="option">-x</code>
          </p><p>
            Lock all tables across all databases. This is achieved by
            acquiring a global read lock for the duration of the whole
            dump. This option automatically turns off
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a> and
            <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqldump_lock-tables"></a>
            <a class="indexterm" name="idm46444425557856"></a>

            <a class="indexterm" name="idm46444425556368"></a>

            <code class="option">--lock-tables</code>, <code class="option">-l</code>
          </p><p>
            For each dumped database, lock all tables to be dumped
            before dumping them. The tables are locked with
            <code class="literal">READ LOCAL</code> to permit concurrent inserts
            in the case of <code class="literal">MyISAM</code> tables. For
            transactional tables such as <code class="literal">InnoDB</code>,
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a> is a
            much better option than <code class="option">--lock-tables</code>
            because it does not need to lock the tables at all.
          </p><p>
            Because <code class="option">--lock-tables</code> locks tables for each
            database separately, this option does not guarantee that the
            tables in the dump file are logically consistent between
            databases. Tables in different databases may be dumped in
            completely different states.
          </p><p>
            Some options, such as
            <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a>, automatically
            enable <code class="option">--lock-tables</code>. If you want to
            override this, use <code class="option">--skip-lock-tables</code> at
            the end of the option list.
          </p></li><li class="listitem"><p><a name="option_mysqldump_no-autocommit"></a>
            <a class="indexterm" name="idm46444425544960"></a>

            <a class="indexterm" name="idm46444425543472"></a>

            <code class="option">--no-autocommit</code>
          </p><p>
            Enclose the <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements
            for each dumped table within <code class="literal">SET autocommit =
            0</code> and <a class="link" href="sql-statements.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"><code class="literal">COMMIT</code></a>
            statements.
          </p></li><li class="listitem"><p><a name="option_mysqldump_order-by-primary"></a>
            <a class="indexterm" name="idm46444425536720"></a>

            <a class="indexterm" name="idm46444425535232"></a>

            <code class="option">--order-by-primary</code>
          </p><p>
            

            Dump each table's rows sorted by its primary key, or by its
            first unique index, if such an index exists. This is useful
            when dumping a <code class="literal">MyISAM</code> table to be loaded
            into an <code class="literal">InnoDB</code> table, but makes the dump
            operation take considerably longer.
          </p></li><li class="listitem"><p><a name="option_mysqldump_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444425529008"></a>

            <a class="indexterm" name="idm46444425527552"></a>

            <a class="link" href="programs.html#option_mysqldump_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqldump_single-transaction"></a>
            <a class="indexterm" name="idm46444425520496"></a>

            <a class="indexterm" name="idm46444425519040"></a>

            <code class="option">--single-transaction</code>
          </p><p>
            This option sets the transaction isolation mode to
            <a class="link" href="innodb-storage-engine.html#isolevel_repeatable-read"><code class="literal">REPEATABLE READ</code></a> and sends
            a <a class="link" href="sql-statements.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"><code class="literal">START
            TRANSACTION</code></a> SQL statement to the server before
            dumping data. It is useful only with transactional tables
            such as <code class="literal">InnoDB</code>, because then it dumps the
            consistent state of the database at the time when
            <a class="link" href="sql-statements.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"><code class="literal">START
            TRANSACTION</code></a> was issued without blocking any
            applications.
          </p><p>
            When using this option, you should keep in mind that only
            <code class="literal">InnoDB</code> tables are dumped in a consistent
            state. For example, any <code class="literal">MyISAM</code> or
            <code class="literal">MEMORY</code> tables dumped while using this
            option may still change state.
          </p><p>
            While a
            <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a> dump
            is in process, to ensure a valid dump file (correct table
            contents and binary log coordinates), no other connection
            should use the following statements:
            <a class="link" href="sql-statements.html#alter-table" title="13.1.9 ALTER TABLE Statement"><code class="literal">ALTER TABLE</code></a>,
            <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a>,
            <a class="link" href="sql-statements.html#drop-table" title="13.1.32 DROP TABLE Statement"><code class="literal">DROP TABLE</code></a>,
            <a class="link" href="sql-statements.html#rename-table" title="13.1.36 RENAME TABLE Statement"><code class="literal">RENAME TABLE</code></a>,
            <a class="link" href="sql-statements.html#truncate-table" title="13.1.37 TRUNCATE TABLE Statement"><code class="literal">TRUNCATE TABLE</code></a>. A consistent
            read is not isolated from those statements, so use of them
            on a table to be dumped can cause the
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> that is performed by
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to retrieve the table contents
            to obtain incorrect contents or fail.
          </p><p>
            The <code class="option">--single-transaction</code> option and the
            <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a> option are
            mutually exclusive because <a class="link" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements"><code class="literal">LOCK
            TABLES</code></a> causes any pending transactions to be
            committed implicitly.
          </p><p>
            To dump large tables, combine the
            <code class="option">--single-transaction</code> option with the
            <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--quick</code></a> option.
</p></li></ul>
</div>
<h4><a name="mysqldump-option-groups"></a>Option Groups</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> option turns on
            several settings that work together to perform a fast dump
            operation. All of these settings are on by default, because
            <code class="option">--opt</code> is on by default. Thus you rarely if
            ever specify <code class="literal">--opt</code>. Instead, you can turn
            these settings off as a group by specifying
            <code class="literal">--skip-opt</code>, the optionally re-enable
            certain settings by specifying the associated options later
            on the command line.
          </p></li><li class="listitem"><p>
            The <a class="link" href="programs.html#option_mysqldump_compact"><code class="option">--compact</code></a> option turns
            off several settings that control whether optional
            statements and comments appear in the output. Again, you can
            follow this option with other options that re-enable certain
            settings, or turn all the settings on by using the
            <code class="literal">--skip-compact</code> form.
</p></li></ul>
</div>
<p>
        When you selectively enable or disable the effect of a group
        option, order is important because options are processed first
        to last. For example,
        <a class="link" href="programs.html#option_mysqldump_disable-keys"><code class="option">--disable-keys</code></a>
        <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a>
        <a class="link" href="programs.html#option_mysqldump_skip-opt"><code class="option">--skip-opt</code></a> would not have the
        intended effect; it is the same as
        <a class="link" href="programs.html#option_mysqldump_skip-opt"><code class="option">--skip-opt</code></a> by itself.
</p>
<h4><a name="mysqldump-option-examples"></a>Examples</h4>
<p>
        To make a backup of an entire database:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump <em class="replaceable"><code>db_name</code></em> &gt; <em class="replaceable"><code>backup-file.sql</code></em></code></strong>
</pre><p>
        To load the dump file back into the server:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql <em class="replaceable"><code>db_name</code></em> &lt; <em class="replaceable"><code>backup-file.sql</code></em></code></strong>
</pre><p>
        Another way to reload the dump file:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql -e "source <em class="replaceable"><code>/path-to-backup/backup-file.sql</code></em>" <em class="replaceable"><code>db_name</code></em></code></strong>
</pre><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> is also very useful for populating
        databases by copying data from one MySQL server to another:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --opt <em class="replaceable"><code>db_name</code></em> | mysql --host=<em class="replaceable"><code>remote_host</code></em> -C <em class="replaceable"><code>db_name</code></em></code></strong>
</pre><p>
        You can dump several databases with one command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --databases <em class="replaceable"><code>db_name1</code></em> [<em class="replaceable"><code>db_name2</code></em> ...] &gt; my_databases.sql</code></strong>
</pre><p>
        To dump all databases, use the
        <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --all-databases &gt; all_databases.sql</code></strong>
</pre><p>
        For <code class="literal">InnoDB</code> tables,
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> provides a way of making an online
        backup:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --all-databases --master-data --single-transaction &gt; all_databases.sql</code></strong>
</pre><p>
        This backup acquires a global read lock on all tables (using
        <a class="link" href="sql-statements.html#flush-tables-with-read-lock"><code class="literal">FLUSH TABLES WITH READ LOCK</code></a>) at
        the beginning of the dump. As soon as this lock has been
        acquired, the binary log coordinates are read and the lock is
        released. If long updating statements are running when the
        <a class="link" href="sql-statements.html#flush" title="13.7.8.3 FLUSH Statement"><code class="literal">FLUSH</code></a> statement is issued, the
        MySQL server may get stalled until those statements finish.
        After that, the dump becomes lock free and does not disturb
        reads and writes on the tables. If the update statements that
        the MySQL server receives are short (in terms of execution
        time), the initial lock period should not be noticeable, even
        with many updates.
      </p><p>
        For point-in-time recovery (also known as
        <span class="quote">“<span class="quote">roll-forward,</span>”</span> when you need to restore an old
        backup and replay the changes that happened since that backup),
        it is often useful to rotate the binary log (see
        <a class="xref" href="server-administration.html#binary-log" title="5.4.4 The Binary Log">Section 5.4.4, “The Binary Log”</a>) or at least know the binary log
        coordinates to which the dump corresponds:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --all-databases --master-data=2 &gt; all_databases.sql</code></strong>
</pre><p>
        Or:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldump --all-databases --flush-logs --master-data=2</code></strong>
              <strong class="userinput"><code>&gt; all_databases.sql</code></strong>
</pre><p>
        The <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data</code></a> and
        <a class="link" href="programs.html#option_mysqldump_single-transaction"><code class="option">--single-transaction</code></a> options
        can be used simultaneously, which provides a convenient way to
        make an online backup suitable for use prior to point-in-time
        recovery if tables are stored using the
        <code class="literal">InnoDB</code> storage engine.
      </p><p>
        For more information on making backups, see
        <a class="xref" href="backup-and-recovery.html#backup-methods" title="7.2 Database Backup Methods">Section 7.2, “Database Backup Methods”</a>, and
        <a class="xref" href="backup-and-recovery.html#backup-strategy-example" title="7.3 Example Backup and Recovery Strategy">Section 7.3, “Example Backup and Recovery Strategy”</a>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            To select the effect of
            <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> except for some
            features, use the <code class="option">--skip</code> option for each
            feature. To disable extended inserts and memory buffering,
            use <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a>
            <a class="link" href="programs.html#option_mysqldump_extended-insert"><code class="option">--skip-extended-insert</code></a>
            <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--skip-quick</code></a>.
            (Actually,
            <a class="link" href="programs.html#option_mysqldump_extended-insert"><code class="option">--skip-extended-insert</code></a>
            <a class="link" href="programs.html#option_mysqldump_quick"><code class="option">--skip-quick</code></a>
            is sufficient because
            <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> is on by default.)
          </p></li><li class="listitem"><p>
            

            To reverse <a class="link" href="programs.html#option_mysqldump_opt"><code class="option">--opt</code></a> for all
            features except index disabling and table locking, use
            <a class="link" href="programs.html#option_mysqldump_skip-opt"><code class="option">--skip-opt</code></a>
            <a class="link" href="programs.html#option_mysqldump_disable-keys"><code class="option">--disable-keys</code></a>
            <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a>.
</p></li></ul>
</div>
<h4><a name="mysqldump-restrictions"></a>Restrictions</h4>
<a class="indexterm" name="idm46444425425120"></a><a class="indexterm" name="idm46444425423632"></a><a class="indexterm" name="idm46444425422144"></a><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> does not dump the
        <code class="literal">performance_schema</code> or <code class="literal">sys</code>
        schema by default. To dump any of these, name them explicitly on
        the command line. You can also name them with the
        <a class="link" href="programs.html#option_mysqldump_databases"><code class="option">--databases</code></a> option. For
        <code class="literal">performance_schema</code>, also use the
        <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--skip-lock-tables</code></a>
        option.
      </p><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> does not dump the
        <code class="literal">INFORMATION_SCHEMA</code> schema.
      </p><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> does not dump
        <code class="literal">InnoDB</code> <a class="link" href="sql-statements.html#create-tablespace" title="13.1.21 CREATE TABLESPACE Statement"><code class="literal">CREATE
        TABLESPACE</code></a> statements.
      </p><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> does not dump the NDB Cluster
        <a class="link" href="mysql-cluster.html#mysql-cluster-ndbinfo" title="22.5.10 ndbinfo: The NDB Cluster Information Database"><code class="literal">ndbinfo</code></a> information database.
      </p><p>
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> includes statements to recreate the
        <code class="literal">general_log</code> and
        <code class="literal">slow_query_log</code> tables for dumps of the
        <code class="literal">mysql</code> database. Log table contents are not
        dumped.
      </p><p>
        If you encounter problems backing up views due to insufficient
        privileges, see <a class="xref" href="stored-objects.html#view-restrictions" title="24.9 Restrictions on Views">Section 24.9, “Restrictions on Views”</a> for a
        workaround.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqlimport"></a>4.5.5 <span class="command"><strong>mysqlimport</strong></span> — A Data Import Program</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444425399120"></a><a class="indexterm" name="idm46444425398176"></a><a class="indexterm" name="idm46444425396816"></a><a class="indexterm" name="idm46444425395456"></a><a class="indexterm" name="idm46444425394096"></a><p>
        The <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> client provides a
        command-line interface to the <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD
        DATA</code></a> SQL statement. Most options to
        <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> correspond directly to clauses of
        <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a> syntax. See
        <a class="xref" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement">Section 13.2.7, “LOAD DATA Statement”</a>.
      </p><p>
        Invoke <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlimport [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>db_name</code></em> <em class="replaceable"><code>textfile1</code></em> [<em class="replaceable"><code>textfile2</code></em> ...]</code></strong>
</pre><p>
        For each text file named on the command line,
        <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> strips any extension from the
        file name and uses the result to determine the name of the table
        into which to import the file's contents. For example, files
        named <code class="filename">patient.txt</code>,
        <code class="filename">patient.text</code>, and
        <code class="filename">patient</code> all would be imported into a table
        named <code class="literal">patient</code>.
      </p><p>
        <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqlimport]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444425372800"></a><p class="title"><b>Table 4.15 mysqlimport Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqlimport."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_columns">--columns</a></td>
<td>This option takes a comma-separated list of column names as its value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_delete">--delete</a></td>
<td>Empty the table before importing the text file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_fields">--fields-enclosed-by</a></td>
<td>This option has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_fields">--fields-escaped-by</a></td>
<td>This option has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_fields">--fields-optionally-enclosed-by</a></td>
<td>This option has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_fields">--fields-terminated-by</a></td>
<td>This option has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_force">--force</a></td>
<td>Continue even if an SQL error occurs</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ignore">--ignore</a></td>
<td>See the description for the --replace option</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ignore-lines">--ignore-lines</a></td>
<td>Ignore the first N lines of the data file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_lines-terminated-by">--lines-terminated-by</a></td>
<td>This option has the same meaning as the corresponding clause for LOAD DATA</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_local">--local</a></td>
<td>Read input files locally from the client host</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_lock-tables">--lock-tables</a></td>
<td>Lock all tables for writing before processing any text files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_low-priority">--low-priority</a></td>
<td>Use LOW_PRIORITY when loading the table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_replace">--replace</a></td>
<td>The --replace and --ignore options control handling of input rows that duplicate existing rows on unique key values</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_silent">--silent</a></td>
<td>Produce output only when errors occur</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_use-threads">--use-threads</a></td>
<td>Number of threads for parallel file-loading</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlimport_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqlimport_help"></a>
            <a class="indexterm" name="idm46444425106960"></a>

            <a class="indexterm" name="idm46444425105504"></a>

            <a class="link" href="programs.html#option_mysqlimport_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_bind-address"></a>
            <a class="indexterm" name="idm46444425100928"></a>

            <a class="indexterm" name="idm46444425099440"></a>

            <a class="link" href="programs.html#option_mysqlimport_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_character-sets-dir"></a>
            <a class="indexterm" name="idm46444425094960"></a>

            <a class="indexterm" name="idm46444425093504"></a>

            <a class="link" href="programs.html#option_mysqlimport_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_columns"></a>
            <a class="indexterm" name="idm46444425088256"></a>

            <a class="indexterm" name="idm46444425086768"></a>

            <a class="link" href="programs.html#option_mysqlimport_columns"><code class="option">--columns=<em class="replaceable"><code>column_list</code></em></code></a>,
            <code class="option">-c <em class="replaceable"><code>column_list</code></em></code>
          </p><p>
            This option takes a list of comma-separated column names as
            its value. The order of the column names indicates how to
            match data file columns with table columns.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_compress"></a>
            <a class="indexterm" name="idm46444425081552"></a>

            <a class="indexterm" name="idm46444425080064"></a>

            <a class="link" href="programs.html#option_mysqlimport_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqlimport_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444425072080"></a><a class="indexterm" name="idm46444425070576"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_debug"></a>
            <a class="indexterm" name="idm46444425063824"></a>

            <a class="indexterm" name="idm46444425062336"></a>

            <a class="link" href="programs.html#option_mysqlimport_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is <code class="literal">d:t:o</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_debug-check"></a>
            <a class="indexterm" name="idm46444425052848"></a>

            <a class="indexterm" name="idm46444425051360"></a>

            <a class="link" href="programs.html#option_mysqlimport_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_debug-info"></a>
            <a class="indexterm" name="idm46444425045264"></a>

            <a class="indexterm" name="idm46444425043776"></a>

            <a class="link" href="programs.html#option_mysqlimport_debug-info"><code class="option">--debug-info</code></a>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_default-character-set"></a>
            <a class="indexterm" name="idm46444425037648"></a>

            <a class="indexterm" name="idm46444425036144"></a>

            <a class="link" href="programs.html#option_mysqlimport_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_default-auth"></a>
            <a class="indexterm" name="idm46444425030624"></a>

            <a class="indexterm" name="idm46444425029136"></a>

            <a class="link" href="programs.html#option_mysqlimport_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444425024032"></a>

            <a class="indexterm" name="idm46444425022576"></a>

            <a class="link" href="programs.html#option_mysqlimport_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_defaults-file"></a>
            <a class="indexterm" name="idm46444425016240"></a>

            <a class="indexterm" name="idm46444425014752"></a>

            <a class="link" href="programs.html#option_mysqlimport_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444425006272"></a>

            <a class="indexterm" name="idm46444425004768"></a>

            <a class="link" href="programs.html#option_mysqlimport_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqlimport]</code> groups. If the
            <a class="link" href="programs.html#option_mysqlimport_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> also reads
            the <code class="literal">[client_other]</code> and
            <code class="literal">[mysqlimport_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_delete"></a>
            <a class="indexterm" name="idm46444424992272"></a>

            <a class="indexterm" name="idm46444424990784"></a>

            <a class="link" href="programs.html#option_mysqlimport_delete"><code class="option">--delete</code></a>,
            <code class="option">-D</code>
          </p><p>
            Empty the table before importing the text file.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444424986192"></a>

            <a class="indexterm" name="idm46444424984736"></a>

            <a class="link" href="programs.html#option_mysqlimport_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysqlimport_fields"></a>
            <a class="indexterm" name="idm46444424979168"></a>

            <a class="indexterm" name="idm46444424977712"></a>

            <a class="link" href="programs.html#option_mysqlimport_fields"><code class="option">--fields-terminated-by=...</code></a>,

            <a class="indexterm" name="idm46444424975200"></a>

            <a class="indexterm" name="idm46444424973696"></a>

            <a class="link" href="programs.html#option_mysqlimport_fields"><code class="option">--fields-enclosed-by=...</code></a>,

            <a class="indexterm" name="idm46444424971184"></a>

            <a class="indexterm" name="idm46444424969680"></a>

            <a class="link" href="programs.html#option_mysqlimport_fields"><code class="option">--fields-optionally-enclosed-by=...</code></a>,

            <a class="indexterm" name="idm46444424967168"></a>

            <a class="indexterm" name="idm46444424965664"></a>

            <a class="link" href="programs.html#option_mysqlimport_fields"><code class="option">--fields-escaped-by=...</code></a>
          </p><p>
            These options have the same meaning as the corresponding
            clauses for <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>. See
            <a class="xref" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement">Section 13.2.7, “LOAD DATA Statement”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_force"></a>
            <a class="indexterm" name="idm46444424959584"></a>

            <a class="indexterm" name="idm46444424958096"></a>

            <a class="link" href="programs.html#option_mysqlimport_force"><code class="option">--force</code></a>,
            <code class="option">-f</code>
          </p><p>
            Ignore errors. For example, if a table for a text file does
            not exist, continue processing any remaining files. Without
            <a class="link" href="programs.html#option_mysqlimport_force"><code class="option">--force</code></a>,
            <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> exits if a table does not
            exist.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_get-server-public-key"></a>
            <a class="indexterm" name="idm46444424951120"></a>

            <a class="indexterm" name="idm46444424949616"></a>

            <a class="link" href="programs.html#option_mysqlimport_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlimport_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlimport_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_host"></a>
            <a class="indexterm" name="idm46444424939440"></a>

            <a class="indexterm" name="idm46444424937984"></a>

            <a class="link" href="programs.html#option_mysqlimport_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Import data to the MySQL server on the given host. The
            default host is <code class="literal">localhost</code>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_ignore"></a>
            <a class="indexterm" name="idm46444424932192"></a>

            <a class="indexterm" name="idm46444424930704"></a>

            <a class="link" href="programs.html#option_mysqlimport_ignore"><code class="option">--ignore</code></a>,
            <code class="option">-i</code>
          </p><p>
            See the description for the
            <a class="link" href="programs.html#option_mysqlimport_replace"><code class="option">--replace</code></a> option.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_ignore-lines"></a>
            <a class="indexterm" name="idm46444424925168"></a>

            <a class="indexterm" name="idm46444424923680"></a>

            <a class="link" href="programs.html#option_mysqlimport_ignore-lines"><code class="option">--ignore-lines=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Ignore the first <em class="replaceable"><code>N</code></em> lines of the
            data file.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_lines-terminated-by"></a>
            <a class="indexterm" name="idm46444424918928"></a>

            <a class="indexterm" name="idm46444424917472"></a>

            <a class="link" href="programs.html#option_mysqlimport_lines-terminated-by"><code class="option">--lines-terminated-by=...</code></a>
          </p><p>
            This option has the same meaning as the corresponding clause
            for <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>. For example,
            to import Windows files that have lines terminated with
            carriage return/linefeed pairs, use
            <a class="link" href="programs.html#option_mysqlimport_lines-terminated-by"><code class="option">--lines-terminated-by="\r\n"</code></a>.
            (You might have to double the backslashes, depending on the
            escaping conventions of your command interpreter.) See
            <a class="xref" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement">Section 13.2.7, “LOAD DATA Statement”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_local"></a>
            <a class="indexterm" name="idm46444424910096"></a>

            <a class="indexterm" name="idm46444424908608"></a>

            <a class="link" href="programs.html#option_mysqlimport_local"><code class="option">--local</code></a>,
            <code class="option">-L</code>
          </p><p>
            By default, files are read by the server on the server host.
            With this option, <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> reads input
            files locally on the client host.
          </p><p>
            Successful use of <code class="literal">LOCAL</code> load operations
            within <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> also requires that the
            server permits local loading; see
            <a class="xref" href="security.html#load-data-local-security" title="6.1.6 Security Considerations for LOAD DATA LOCAL">Section 6.1.6, “Security Considerations for LOAD DATA LOCAL”</a>
          </p></li><li class="listitem"><p><a name="option_mysqlimport_lock-tables"></a>
            <a class="indexterm" name="idm46444424899648"></a>

            <a class="indexterm" name="idm46444424898160"></a>

            <a class="link" href="programs.html#option_mysqldump_lock-tables"><code class="option">--lock-tables</code></a>,
            <code class="option">-l</code>
          </p><p>
            Lock <span class="emphasis"><em>all</em></span> tables for writing before
            processing any text files. This ensures that all tables are
            synchronized on the server.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_login-path"></a>
            <a class="indexterm" name="idm46444424893168"></a>

            <a class="indexterm" name="idm46444424891680"></a>

            <a class="link" href="programs.html#option_mysqlimport_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_low-priority"></a>
            <a class="indexterm" name="idm46444424882832"></a>

            <a class="indexterm" name="idm46444424881344"></a>

            <a class="link" href="programs.html#option_mysqlimport_low-priority"><code class="option">--low-priority</code></a>
          </p><p>
            Use <code class="literal">LOW_PRIORITY</code> when loading the table.
            This affects only storage engines that use only table-level
            locking (such as <code class="literal">MyISAM</code>,
            <code class="literal">MEMORY</code>, and <code class="literal">MERGE</code>).
          </p></li><li class="listitem"><p><a name="option_mysqlimport_no-defaults"></a>
            <a class="indexterm" name="idm46444424874256"></a>

            <a class="indexterm" name="idm46444424872768"></a>

            <a class="link" href="programs.html#option_mysqlimport_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqlimport_no-defaults"><code class="option">--no-defaults</code></a> can be
            used to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqlimport_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_password"></a>
            <a class="indexterm" name="idm46444424861376"></a>

            <a class="indexterm" name="idm46444424859888"></a>

            <a class="link" href="programs.html#option_mysqlimport_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqlimport_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> should not prompt for one,
            use the
            <a class="link" href="programs.html#option_mysqlimport_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_pipe"></a>
            <a class="indexterm" name="idm46444424847168"></a>

            <a class="indexterm" name="idm46444424845712"></a>

            <a class="link" href="programs.html#option_mysqlimport_pipe"><code class="option">--pipe</code></a>,
            <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_plugin-dir"></a>
            <a class="indexterm" name="idm46444424838320"></a>

            <a class="indexterm" name="idm46444424836832"></a>

            <a class="link" href="programs.html#option_mysqlimport_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqlimport_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_port"></a>
            <a class="indexterm" name="idm46444424829344"></a>

            <a class="indexterm" name="idm46444424827888"></a>

            <a class="link" href="programs.html#option_mysqlimport_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_print-defaults"></a>
            <a class="indexterm" name="idm46444424822848"></a>

            <a class="indexterm" name="idm46444424821360"></a>

            <a class="link" href="programs.html#option_mysqlimport_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_protocol"></a>
            <a class="indexterm" name="idm46444424816000"></a>

            <a class="indexterm" name="idm46444424814512"></a>

            <a class="link" href="programs.html#option_mysqlimport_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_replace"></a>
            <a class="indexterm" name="idm46444424809520"></a>

            <a class="indexterm" name="idm46444424808032"></a>

            <a class="link" href="programs.html#option_mysqlimport_replace"><code class="option">--replace</code></a>,
            <code class="option">-r</code>
          </p><p>
            The <a class="link" href="programs.html#option_mysqlimport_replace"><code class="option">--replace</code></a> and
            <a class="link" href="programs.html#option_mysqlimport_ignore"><code class="option">--ignore</code></a> options control
            handling of input rows that duplicate existing rows on
            unique key values. If you specify
            <a class="link" href="programs.html#option_mysqlimport_replace"><code class="option">--replace</code></a>, new rows
            replace existing rows that have the same unique key value.
            If you specify <a class="link" href="programs.html#option_mysqlimport_ignore"><code class="option">--ignore</code></a>,
            input rows that duplicate an existing row on a unique key
            value are skipped. If you do not specify either option, an
            error occurs when a duplicate key value is found, and the
            rest of the text file is ignored.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_server-public-key-path"></a>
            <a class="indexterm" name="idm46444424798976"></a>

            <a class="indexterm" name="idm46444424797520"></a>

            <a class="link" href="programs.html#option_mysqlimport_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlimport_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlimport_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444424783680"></a>

            <a class="indexterm" name="idm46444424782224"></a>

            <a class="link" href="programs.html#option_mysqlimport_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_silent"></a>
            <a class="indexterm" name="idm46444424775104"></a>

            <a class="indexterm" name="idm46444424773616"></a>

            <a class="link" href="programs.html#option_mysqlimport_silent"><code class="option">--silent</code></a>,
            <code class="option">-s</code>
          </p><p>
            Silent mode. Produce output only when errors occur.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_socket"></a>
            <a class="indexterm" name="idm46444424769040"></a>

            <a class="indexterm" name="idm46444424767552"></a>

            <a class="link" href="programs.html#option_mysqlimport_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_ssl"></a>
            <a class="indexterm" name="idm46444424758512"></a>

            <a class="indexterm" name="idm46444424757056"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqlimport_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444424751168"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqlimport_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqlimport_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqlimport_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqlimport_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlimport_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444424734112"></a>

            <a class="indexterm" name="idm46444424732624"></a>

            <a class="link" href="programs.html#option_mysqlimport_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_tls-version"></a>
            <a class="indexterm" name="idm46444424726752"></a>

            <a class="indexterm" name="idm46444424725264"></a>

            <a class="link" href="programs.html#option_mysqlimport_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_user"></a>
            <a class="indexterm" name="idm46444424719952"></a>

            <a class="indexterm" name="idm46444424718496"></a>

            <a class="link" href="programs.html#option_mysqlimport_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_use-threads"></a>
            <a class="indexterm" name="idm46444424713408"></a>

            <a class="indexterm" name="idm46444424711920"></a>

            <a class="link" href="programs.html#option_mysqlimport_use-threads"><code class="option">--use-threads=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Load files in parallel using <em class="replaceable"><code>N</code></em>
            threads.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_verbose"></a>
            <a class="indexterm" name="idm46444424707168"></a>

            <a class="indexterm" name="idm46444424705680"></a>

            <a class="link" href="programs.html#option_mysqlimport_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_version"></a>
            <a class="indexterm" name="idm46444424701088"></a>

            <a class="indexterm" name="idm46444424699600"></a>

            <a class="link" href="programs.html#option_mysqlimport_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlimport_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqlimport_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444424693632"></a><a class="indexterm" name="idm46444424692128"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>
<p>
        Here is a sample session that demonstrates use of
        <a class="link" href="programs.html#mysqlimport" title="4.5.5 mysqlimport — A Data Import Program"><span class="command"><strong>mysqlimport</strong></span></a>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql -e 'CREATE TABLE imptest(id INT, n VARCHAR(30))' test</code></strong>
shell&gt; <strong class="userinput"><code>ed</code></strong>
a
100     Max Sydow
101     Count Dracula
.
w imptest.txt
32
q
shell&gt; <strong class="userinput"><code>od -c imptest.txt</code></strong>
0000000   1   0   0  \t   M   a   x       S   y   d   o   w  \n   1   0
0000020   1  \t   C   o   u   n   t       D   r   a   c   u   l   a  \n
0000040
shell&gt; <strong class="userinput"><code>mysqlimport --local test imptest.txt</code></strong>
test.imptest: Records: 2  Deleted: 0  Skipped: 0  Warnings: 0
shell&gt; <strong class="userinput"><code>mysql -e 'SELECT * FROM imptest' test</code></strong>
+------+---------------+
| id   | n             |
+------+---------------+
|  100 | Max Sydow     |
|  101 | Count Dracula |
+------+---------------+
</pre>
</div>

<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqlpump"></a>4.5.6 <span class="command"><strong>mysqlpump</strong></span> — A Database Backup Program</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444424677184"></a><a class="indexterm" name="idm46444424676240"></a><a class="indexterm" name="idm46444424674880"></a><a class="indexterm" name="idm46444424673520"></a><a class="indexterm" name="idm46444424672160"></a>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#mysqlpump-syntax" title="mysqlpump Invocation Syntax">mysqlpump Invocation Syntax</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlpump-option-summary" title="mysqlpump Option Summary">mysqlpump Option Summary</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlpump-options" title="mysqlpump Option Descriptions">mysqlpump Option Descriptions</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlpump-parallelism" title="mysqlpump Parallel Processing">mysqlpump Parallel Processing</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlpump-restrictions" title="mysqlpump Restrictions">mysqlpump Restrictions</a></p></li></ul>
</div>
<p>
        The <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> client utility performs
        <a class="link" href="glossary.html#glos_logical_backup" title="logical backup">logical backups</a>,
        producing a set of SQL statements that can be executed to
        reproduce the original database object definitions and table
        data. It dumps one or more MySQL databases for backup or
        transfer to another SQL server.
      </p><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> features include:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Parallel processing of databases, and of objects within
            databases, to speed up the dump process
          </p></li><li class="listitem"><p>
            Better control over which databases and database objects
            (tables, stored programs, user accounts) to dump
          </p></li><li class="listitem"><p>
            Dumping of user accounts as account-management statements
            (<a class="link" href="sql-statements.html#create-user" title="13.7.1.3 CREATE USER Statement"><code class="literal">CREATE USER</code></a>,
            <a class="link" href="sql-statements.html#grant" title="13.7.1.6 GRANT Statement"><code class="literal">GRANT</code></a>) rather than as inserts
            into the <code class="literal">mysql</code> system database
          </p></li><li class="listitem"><p>
            Capability of creating compressed output
          </p></li><li class="listitem"><p>
            Progress indicator (the values are estimates)
          </p></li><li class="listitem"><p>
            For dump file reloading, faster secondary index creation for
            <code class="literal">InnoDB</code> tables by adding indexes after
            rows are inserted
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
          <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> uses MySQL features introduced in
          MySQL 5.7, and thus assumes use with MySQL 5.7 or higher.
</p>
</div>
<p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> requires at least the
        <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> privilege for dumped
        tables, <a class="link" href="security.html#priv_show-view"><code class="literal">SHOW VIEW</code></a> for dumped
        views, <a class="link" href="security.html#priv_trigger"><code class="literal">TRIGGER</code></a> for dumped
        triggers, and <a class="link" href="security.html#priv_lock-tables"><code class="literal">LOCK TABLES</code></a> if the
        <a class="link" href="programs.html#option_mysqlpump_single-transaction"><code class="option">--single-transaction</code></a> option is
        not used. The <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> privilege on
        the <code class="literal">mysql</code> system database is required to dump
        user definitions. Certain options might require other privileges
        as noted in the option descriptions.
      </p><p>
        To reload a dump file, you must have the privileges required to
        execute the statements that it contains, such as the appropriate
        <code class="literal">CREATE</code> privileges for objects created by
        those statements.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          A dump made using PowerShell on Windows with output
          redirection creates a file that has UTF-16 encoding:
        </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump [options] &gt; dump.sql</code></strong>
</pre><p>
          However, UTF-16 is not permitted as a connection character set
          (see <a class="xref" href="charset.html#charset-connection" title="10.4 Connection Character Sets and Collations">Section 10.4, “Connection Character Sets and Collations”</a>), so the dump file
          will not load correctly. To work around this issue, use the
          <code class="option">--result-file</code> option, which creates the
          output in ASCII format:
        </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump [options] --result-file=dump.sql</code></strong>
</pre>
</div>
<h4><a name="mysqlpump-syntax"></a>mysqlpump Invocation Syntax</h4>
<p>
        By default, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> dumps all databases
        (with certain exceptions noted in
        <a class="xref" href="programs.html#mysqlpump-restrictions" title="mysqlpump Restrictions">mysqlpump Restrictions</a>). To specify this
        behavior explicitly, use the
        <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a> option:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --all-databases</code></strong>
</pre><p>
        To dump a single database, or certain tables within that
        database, name the database on the command line, optionally
        followed by table names:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump <em class="replaceable"><code>db_name</code></em></code></strong>
shell&gt; <strong class="userinput"><code>mysqlpump <em class="replaceable"><code>db_name tbl_name1 tbl_name2 ...</code></em></code></strong>
</pre><p>
        To treat all name arguments as database names, use the
        <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> option:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --databases <em class="replaceable"><code>db_name1 db_name2</code></em> ...</code></strong>
</pre><p>
        By default, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not dump user
        account definitions, even if you dump the
        <code class="literal">mysql</code> system database that contains the grant
        tables. To dump grant table contents as logical definitions in
        the form of <a class="link" href="sql-statements.html#create-user" title="13.7.1.3 CREATE USER Statement"><code class="literal">CREATE USER</code></a> and
        <a class="link" href="sql-statements.html#grant" title="13.7.1.6 GRANT Statement"><code class="literal">GRANT</code></a> statements, use the
        <a class="link" href="programs.html#option_mysqlpump_users"><code class="option">--users</code></a> option and suppress
        all database dumping:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --exclude-databases=% --users</code></strong>
</pre><p>
        In the preceding command, <code class="literal">%</code> is a wildcard
        that matches all database names for the
        <a class="link" href="programs.html#option_mysqlpump_exclude-databases"><code class="option">--exclude-databases</code></a> option.
      </p><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> supports several options for
        including or excluding databases, tables, stored programs, and
        user definitions. See <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
      </p><p>
        To reload a dump file, execute the statements that it contains.
        For example, use the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump [options] &gt; dump.sql</code></strong>
shell&gt; <strong class="userinput"><code>mysql &lt; dump.sql</code></strong>
</pre><p>
        The following discussion provides additional
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> usage examples.
      </p><p>
        To see a list of the options <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>
        supports, issue the command <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump --help</strong></span></a>.
</p>
<h4><a name="mysqlpump-option-summary"></a>mysqlpump Option Summary</h4>
<p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqlpump]</code> and <code class="literal">[client]</code>
        groups of an option file. (Prior to MySQL 8.0.20,
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> read the
        <code class="literal">[mysql_dump]</code> group rather than
        <code class="literal">[mysqlpump]</code>. As of 8.0.20,
        <code class="literal">[mysql_dump]</code> is still accepted but is
        deprecated.) For information about option files used by MySQL
        programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444424587312"></a><p class="title"><b>Table 4.16 mysqlpump Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqlpump."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_add-drop-database">--add-drop-database</a></td>
<td>Add DROP DATABASE statement before each CREATE DATABASE statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_add-drop-table">--add-drop-table</a></td>
<td>Add DROP TABLE statement before each CREATE TABLE statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_add-drop-user">--add-drop-user</a></td>
<td>Add DROP USER statement before each CREATE USER statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_add-locks">--add-locks</a></td>
<td>Surround each table dump with LOCK TABLES and UNLOCK TABLES statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_all-databases">--all-databases</a></td>
<td>Dump all databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_character-sets-dir">--character-sets-dir</a></td>
<td>Directory where character sets are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_column-statistics">--column-statistics</a></td>
<td>Write ANALYZE TABLE statements to generate statistics histograms</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_complete-insert">--complete-insert</a></td>
<td>Use complete INSERT statements that include column names</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_compress-output">--compress-output</a></td>
<td>Output compression algorithm</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_databases">--databases</a></td>
<td>Interpret all name arguments as database names</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_default-parallelism">--default-parallelism</a></td>
<td>Default number of threads for parallel processing</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_defer-table-indexes">--defer-table-indexes</a></td>
<td>For reloading, defer index creation until after loading table rows</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_events">--events</a></td>
<td>Dump events from dumped databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_exclude-databases">--exclude-databases</a></td>
<td>Databases to exclude from dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_exclude-events">--exclude-events</a></td>
<td>Events to exclude from dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_exclude-routines">--exclude-routines</a></td>
<td>Routines to exclude from dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_exclude-tables">--exclude-tables</a></td>
<td>Tables to exclude from dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_exclude-triggers">--exclude-triggers</a></td>
<td>Triggers to exclude from dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_exclude-users">--exclude-users</a></td>
<td>Users to exclude from dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_extended-insert">--extended-insert</a></td>
<td>Use multiple-row INSERT syntax</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_hex-blob">--hex-blob</a></td>
<td>Dump binary columns using hexadecimal notation</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_include-databases">--include-databases</a></td>
<td>Databases to include in dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_include-events">--include-events</a></td>
<td>Events to include in dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_include-routines">--include-routines</a></td>
<td>Routines to include in dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_include-tables">--include-tables</a></td>
<td>Tables to include in dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_include-triggers">--include-triggers</a></td>
<td>Triggers to include in dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_include-users">--include-users</a></td>
<td>Users to include in dump</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_insert-ignore">--insert-ignore</a></td>
<td>Write INSERT IGNORE rather than INSERT statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_log-error-file">--log-error-file</a></td>
<td>Append warnings and errors to named file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_max-allowed-packet">--max-allowed-packet</a></td>
<td>Maximum packet length to send to or receive from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_net-buffer-length">--net-buffer-length</a></td>
<td>Buffer size for TCP/IP and socket communication</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_no-create-db">--no-create-db</a></td>
<td>Do not write CREATE DATABASE statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_no-create-info">--no-create-info</a></td>
<td>Do not write CREATE TABLE statements that re-create each dumped table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_parallel-schemas">--parallel-schemas</a></td>
<td>Specify schema-processing parallelism</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_replace">--replace</a></td>
<td>Write REPLACE statements rather than INSERT statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_result-file">--result-file</a></td>
<td>Direct output to a given file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_routines">--routines</a></td>
<td>Dump stored routines (procedures and functions) from dumped databases</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_set-charset">--set-charset</a></td>
<td>Add SET NAMES default_character_set to output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_set-gtid-purged">--set-gtid-purged</a></td>
<td>Whether to add SET @@GLOBAL.GTID_PURGED to output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_single-transaction">--single-transaction</a></td>
<td>Dump tables within single transaction</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_skip-definer">--skip-definer</a></td>
<td>Omit DEFINER and SQL SECURITY clauses from view and stored program CREATE statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_skip-dump-rows">--skip-dump-rows</a></td>
<td>Do not dump table rows</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_triggers">--triggers</a></td>
<td>Dump triggers for each dumped table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_tz-utc">--tz-utc</a></td>
<td>Add SET TIME_ZONE='+00:00' to dump file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_users">--users</a></td>
<td>Dump user accounts</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_watch-progress">--watch-progress</a></td>
<td>Display progress indicator</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlpump_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<h4><a name="mysqlpump-options"></a>mysqlpump Option Descriptions</h4>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqlpump_help"></a>
            <a class="indexterm" name="idm46444424204880"></a>

            <a class="indexterm" name="idm46444424203424"></a>

            <a class="link" href="programs.html#option_mysqlpump_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_add-drop-database"></a>
            <a class="indexterm" name="idm46444424198848"></a>

            <a class="indexterm" name="idm46444424197392"></a>

            <a class="link" href="programs.html#option_mysqlpump_add-drop-database"><code class="option">--add-drop-database</code></a>
          </p><p>
            Write a <a class="link" href="sql-statements.html#drop-database" title="13.1.24 DROP DATABASE Statement"><code class="literal">DROP DATABASE</code></a>
            statement before each <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE
            DATABASE</code></a> statement.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              In MySQL 8.0, the <code class="literal">mysql</code>
              schema is considered a system schema that cannot be
              dropped by end users. If
              <a class="link" href="programs.html#option_mysqlpump_add-drop-database"><code class="option">--add-drop-database</code></a> is
              used with
              <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a> or with
              <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> where the
              list of schemas to be dumped includes
              <code class="literal">mysql</code>, the dump file will contain a
              <code class="literal">DROP DATABASE `mysql`</code> statement that
              causes an error when the dump file is reloaded.
            </p><p>
              Instead, to use
              <a class="link" href="programs.html#option_mysqlpump_add-drop-database"><code class="option">--add-drop-database</code></a>, use
              <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> with a list
              of schemas to be dumped, where the list does not include
              <code class="literal">mysql</code>.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlpump_add-drop-table"></a>
            <a class="indexterm" name="idm46444424181232"></a>

            <a class="indexterm" name="idm46444424179744"></a>

            <a class="link" href="programs.html#option_mysqlpump_add-drop-table"><code class="option">--add-drop-table</code></a>
          </p><p>
            Write a <a class="link" href="sql-statements.html#drop-table" title="13.1.32 DROP TABLE Statement"><code class="literal">DROP TABLE</code></a> statement
            before each <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a>
            statement.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_add-drop-user"></a>
            <a class="indexterm" name="idm46444424173152"></a>

            <a class="indexterm" name="idm46444424171664"></a>

            <a class="link" href="programs.html#option_mysqlpump_add-drop-user"><code class="option">--add-drop-user</code></a>
          </p><p>
            Write a <a class="link" href="sql-statements.html#drop-user" title="13.7.1.5 DROP USER Statement"><code class="literal">DROP USER</code></a> statement
            before each <a class="link" href="sql-statements.html#create-user" title="13.7.1.3 CREATE USER Statement"><code class="literal">CREATE USER</code></a>
            statement.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_add-locks"></a>
            <a class="indexterm" name="idm46444424165072"></a>

            <a class="indexterm" name="idm46444424163584"></a>

            <a class="link" href="programs.html#option_mysqlpump_add-locks"><code class="option">--add-locks</code></a>
          </p><p>
            Surround each table dump with <a class="link" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements"><code class="literal">LOCK
            TABLES</code></a> and
            <a class="link" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements"><code class="literal">UNLOCK
            TABLES</code></a> statements. This results in faster inserts
            when the dump file is reloaded. See
            <a class="xref" href="optimization.html#insert-optimization" title="8.2.5.1 Optimizing INSERT Statements">Section 8.2.5.1, “Optimizing INSERT Statements”</a>.
          </p><p>
            This option does not work with parallelism because
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements from
            different tables can be interleaved and
            <a class="link" href="sql-statements.html#lock-tables" title="13.3.6 LOCK TABLES and UNLOCK TABLES Statements"><code class="literal">UNLOCK
            TABLES</code></a> following the end of the inserts for one
            table could release locks on tables for which inserts
            remain.
          </p><p>
            <a class="link" href="programs.html#option_mysqlpump_add-locks"><code class="option">--add-locks</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_single-transaction"><code class="option">--single-transaction</code></a> are
            mutually exclusive.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_all-databases"></a>
            <a class="indexterm" name="idm46444424150720"></a>

            <a class="indexterm" name="idm46444424149232"></a>

            <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a>,
            <code class="option">-A</code>
          </p><p>
            Dump all databases (with certain exceptions noted in
            <a class="xref" href="programs.html#mysqlpump-restrictions" title="mysqlpump Restrictions">mysqlpump Restrictions</a>). This is the
            default behavior if no other is specified explicitly.
          </p><p>
            <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> are mutually
            exclusive.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              See the
              <a class="link" href="programs.html#option_mysqlpump_add-drop-database"><code class="option">--add-drop-database</code></a>
              description for information about an incompatibility of
              that option with
              <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a>.
</p>
</div>
<p>
            Prior to MySQL 8.0, the
            <a class="link" href="programs.html#option_mysqldump_routines"><code class="option">--routines</code></a> and
            <a class="link" href="programs.html#option_mysqldump_events"><code class="option">--events</code></a> options for
            <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> and
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> were not required to include
            stored routines and events when using the
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a> option:
            The dump included the <code class="literal">mysql</code> system
            database, and therefore also the
            <code class="literal">mysql.proc</code> and
            <code class="literal">mysql.event</code> tables containing stored
            routine and event definitions. As of MySQL 8.0,
            the <code class="literal">mysql.event</code> and
            <code class="literal">mysql.proc</code> tables are not used.
            Definitions for the corresponding objects are stored in data
            dictionary tables, but those tables are not dumped. To
            include stored routines and events in a dump made using
            <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a>, use the
            <a class="link" href="programs.html#option_mysqldump_routines"><code class="option">--routines</code></a> and
            <a class="link" href="programs.html#option_mysqldump_events"><code class="option">--events</code></a> options
            explicitly.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_bind-address"></a>
            <a class="indexterm" name="idm46444424125696"></a>

            <a class="indexterm" name="idm46444424124208"></a>

            <a class="link" href="programs.html#option_mysqlpump_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_character-sets-dir"></a>
            <a class="indexterm" name="idm46444424119728"></a>

            <a class="indexterm" name="idm46444424118272"></a>

            <a class="link" href="programs.html#option_mysqlpump_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>path</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_column-statistics"></a>
            <a class="link" href="programs.html#option_mysqlpump_column-statistics"><code class="option">--column-statistics</code></a>
          </p><a class="indexterm" name="idm46444424112064"></a><a class="indexterm" name="idm46444424110608"></a><p>
            Add <a class="link" href="sql-statements.html#analyze-table" title="13.7.3.1 ANALYZE TABLE Statement"><code class="literal">ANALYZE TABLE</code></a> statements
            to the output to generate histogram statistics for dumped
            tables when the dump file is reloaded. This option is
            disabled by default because histogram generation for large
            tables can take a long time.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_complete-insert"></a>
            <a class="indexterm" name="idm46444424106112"></a>

            <a class="indexterm" name="idm46444424104624"></a>

            <a class="link" href="programs.html#option_mysqlpump_complete-insert"><code class="option">--complete-insert</code></a>
          </p><p>
            Write complete <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements that include column names.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_compress"></a>
            <a class="indexterm" name="idm46444424099296"></a>

            <a class="indexterm" name="idm46444424097808"></a>

            <a class="link" href="programs.html#option_mysqlpump_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_compress-output"></a>
            <a class="indexterm" name="idm46444424091296"></a>

            <a class="indexterm" name="idm46444424089808"></a>

            <a class="link" href="programs.html#option_mysqlpump_compress-output"><code class="option">--compress-output=<em class="replaceable"><code>algorithm</code></em></code></a>
          </p><p>
            By default, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not compress
            output. This option specifies output compression using the
            specified algorithm. Permitted algorithms are
            <code class="literal">LZ4</code> and <code class="literal">ZLIB</code>.
          </p><p>
            To uncompress compressed output, you must have an
            appropriate utility. If the system commands
            <span class="command"><strong>lz4</strong></span> and <span class="command"><strong>openssl zlib</strong></span>
            are not available, MySQL distributions include
            <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a> and
            <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a> utilities that can be
            used to decompress <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> output that
            was compressed using the
            <a class="link" href="programs.html#option_mysqlpump_compress-output"><code class="option">--compress-output=LZ4</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_compress-output"><code class="option">--compress-output=ZLIB</code></a>
            options. For more information, see
            <a class="xref" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output">Section 4.8.1, “<span class="command"><strong>lz4_decompress</strong></span> — Decompress mysqlpump LZ4-Compressed Output”</a>, and
            <a class="xref" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output">Section 4.8.3, “<span class="command"><strong>zlib_decompress</strong></span> — Decompress mysqlpump ZLIB-Compressed Output”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqlpump_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444424072080"></a><a class="indexterm" name="idm46444424070576"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_databases"></a>
            <a class="indexterm" name="idm46444424063760"></a>

            <a class="indexterm" name="idm46444424062272"></a>

            <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a>,
            <code class="option">-B</code>
          </p><p>
            Normally, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> treats the first name
            argument on the command line as a database name and any
            following names as table names. With this option, it treats
            all name arguments as database names.
            <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE DATABASE</code></a> statements
            are included in the output before each new database.
          </p><p>
            <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> are mutually
            exclusive.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              See the
              <a class="link" href="programs.html#option_mysqlpump_add-drop-database"><code class="option">--add-drop-database</code></a>
              description for information about an incompatibility of
              that option with
              <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a>.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlpump_debug"></a>
            <a class="indexterm" name="idm46444424049792"></a>

            <a class="indexterm" name="idm46444424048336"></a>

            <a class="link" href="programs.html#option_mysqlpump_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:O,/tmp/mysqlpump.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_debug-check"></a>
            <a class="indexterm" name="idm46444424038784"></a>

            <a class="indexterm" name="idm46444424037296"></a>

            <a class="link" href="programs.html#option_mysqlpump_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_debug-info"></a>
            <a class="indexterm" name="idm46444424031200"></a>

            <a class="indexterm" name="idm46444424029712"></a>

            <a class="link" href="programs.html#option_mysqlpump_debug-info"><code class="option">--debug-info</code></a>,
            <code class="option">-T</code>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_default-auth"></a>
            <a class="indexterm" name="idm46444424023216"></a>

            <a class="indexterm" name="idm46444424021728"></a>

            <a class="link" href="programs.html#option_mysqlpump_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_default-character-set"></a>
            <a class="indexterm" name="idm46444424016624"></a>

            <a class="indexterm" name="idm46444424015168"></a>

            <a class="link" href="programs.html#option_mysqlpump_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
            If no character set is specified,
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> uses <code class="literal">utf8</code>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_default-parallelism"></a>
            <a class="indexterm" name="idm46444424007616"></a>

            <a class="indexterm" name="idm46444424006160"></a>

            <a class="link" href="programs.html#option_mysqlpump_default-parallelism"><code class="option">--default-parallelism=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            The default number of threads for each parallel processing
            queue. The default is 2.
          </p><p>
            The <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas</code></a>
            option also affects parallelism and can be used to override
            the default number of threads. For more information, see
            <a class="xref" href="programs.html#mysqlpump-parallelism" title="mysqlpump Parallel Processing">mysqlpump Parallel Processing</a>.
          </p><p>
            With
            <a class="link" href="programs.html#option_mysqlpump_default-parallelism"><code class="option">--default-parallelism=0</code></a>
            and no <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas</code></a>
            options, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> runs as a
            single-threaded process and creates no queues.
          </p><p>
            With parallelism enabled, it is possible for output from
            different databases to be interleaved.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444423995184"></a>

            <a class="indexterm" name="idm46444423993728"></a>

            <a class="link" href="programs.html#option_mysqlpump_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_defaults-file"></a>
            <a class="indexterm" name="idm46444423987392"></a>

            <a class="indexterm" name="idm46444423985904"></a>

            <a class="link" href="programs.html#option_mysqlpump_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444423977536"></a>

            <a class="indexterm" name="idm46444423976080"></a>

            <a class="link" href="programs.html#option_mysqlpump_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqlpump]</code> groups. If the
            <a class="link" href="programs.html#option_mysqlpump_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysqlpump_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_defer-table-indexes"></a>
            <a class="indexterm" name="idm46444423963520"></a>

            <a class="indexterm" name="idm46444423962064"></a>

            <a class="link" href="programs.html#option_mysqlpump_defer-table-indexes"><code class="option">--defer-table-indexes</code></a>
          </p><p>
            In the dump output, defer index creation for each table
            until after its rows have been loaded. This works for all
            storage engines, but for <code class="literal">InnoDB</code> applies
            only for secondary indexes.
          </p><p>
            This option is enabled by default; use
            <a class="link" href="programs.html#option_mysqlpump_defer-table-indexes"><code class="option">--skip-defer-table-indexes</code></a>
            to disable it.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_events"></a>
            <a class="indexterm" name="idm46444423955600"></a>

            <a class="indexterm" name="idm46444423954144"></a>

            <a class="link" href="programs.html#option_mysqlpump_events"><code class="option">--events</code></a>
          </p><p>
            Include Event Scheduler events for the dumped databases in
            the output. Event dumping requires the
            <a class="link" href="security.html#priv_event"><code class="literal">EVENT</code></a> privileges for those
            databases.
          </p><p>
            The output generated by using
            <a class="link" href="programs.html#option_mysqlpump_events"><code class="option">--events</code></a> contains
            <a class="link" href="sql-statements.html#create-event" title="13.1.13 CREATE EVENT Statement"><code class="literal">CREATE EVENT</code></a> statements to
            create the events.
          </p><p>
            This option is enabled by default; use
            <a class="link" href="programs.html#option_mysqlpump_events"><code class="option">--skip-events</code></a>
            to disable it.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_exclude-databases"></a>
            <a class="indexterm" name="idm46444423944528"></a>

            <a class="indexterm" name="idm46444423943072"></a>

            <a class="link" href="programs.html#option_mysqlpump_exclude-databases"><code class="option">--exclude-databases=<em class="replaceable"><code>db_list</code></em></code></a>
          </p><p>
            Do not dump the databases in
            <em class="replaceable"><code>db_list</code></em>, which is a list of one
            or more comma-separated database names. Multiple instances
            of this option are additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_exclude-events"></a>
            <a class="indexterm" name="idm46444423937312"></a>

            <a class="indexterm" name="idm46444423935824"></a>

            <a class="link" href="programs.html#option_mysqlpump_exclude-events"><code class="option">--exclude-events=<em class="replaceable"><code>event_list</code></em></code></a>
          </p><p>
            Do not dump the databases in
            <em class="replaceable"><code>event_list</code></em>, which is a list of
            one or more comma-separated event names. Multiple instances
            of this option are additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_exclude-routines"></a>
            <a class="indexterm" name="idm46444423930128"></a>

            <a class="indexterm" name="idm46444423928640"></a>

            <a class="link" href="programs.html#option_mysqlpump_exclude-routines"><code class="option">--exclude-routines=<em class="replaceable"><code>routine_list</code></em></code></a>
          </p><p>
            Do not dump the events in
            <em class="replaceable"><code>routine_list</code></em>, which is a list of
            one or more comma-separated routine (stored procedure or
            function) names. Multiple instances of this option are
            additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_exclude-tables"></a>
            <a class="indexterm" name="idm46444423922896"></a>

            <a class="indexterm" name="idm46444423921408"></a>

            <a class="link" href="programs.html#option_mysqlpump_exclude-tables"><code class="option">--exclude-tables=<em class="replaceable"><code>table_list</code></em></code></a>
          </p><p>
            Do not dump the tables in
            <em class="replaceable"><code>table_list</code></em>, which is a list of
            one or more comma-separated table names. Multiple instances
            of this option are additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_exclude-triggers"></a>
            <a class="indexterm" name="idm46444423915776"></a>

            <a class="indexterm" name="idm46444423914288"></a>

            <a class="link" href="programs.html#option_mysqlpump_exclude-triggers"><code class="option">--exclude-triggers=<em class="replaceable"><code>trigger_list</code></em></code></a>
          </p><p>
            Do not dump the triggers in
            <em class="replaceable"><code>trigger_list</code></em>, which is a list of
            one or more comma-separated trigger names. Multiple
            instances of this option are additive. For more information,
            see <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_exclude-users"></a>
            <a class="indexterm" name="idm46444423908656"></a>

            <a class="indexterm" name="idm46444423907168"></a>

            <a class="link" href="programs.html#option_mysqlpump_exclude-users"><code class="option">--exclude-users=<em class="replaceable"><code>user_list</code></em></code></a>
          </p><p>
            Do not dump the user accounts in
            <em class="replaceable"><code>user_list</code></em>, which is a list of one
            or more comma-separated account names. Multiple instances of
            this option are additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_extended-insert"></a>
            <a class="indexterm" name="idm46444423901520"></a>

            <a class="indexterm" name="idm46444423900032"></a>

            <a class="link" href="programs.html#option_mysqlpump_extended-insert"><code class="option">--extended-insert=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Write <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements using
            multiple-row syntax that includes several
            <code class="literal">VALUES</code> lists. This results in a smaller
            dump file and speeds up inserts when the file is reloaded.
          </p><p>
            The option value indicates the number of rows to include in
            each <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statement. The
            default is 250. A value of 1 produces one
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statement per table
            row.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_get-server-public-key"></a>
            <a class="indexterm" name="idm46444423890576"></a>

            <a class="indexterm" name="idm46444423889120"></a>

            <a class="link" href="programs.html#option_mysqlpump_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlpump_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlpump_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_hex-blob"></a>
            <a class="indexterm" name="idm46444423878976"></a>

            <a class="indexterm" name="idm46444423877488"></a>

            <a class="link" href="programs.html#option_mysqlpump_hex-blob"><code class="option">--hex-blob</code></a>
          </p><p>
            Dump binary columns using hexadecimal notation (for example,
            <code class="literal">'abc'</code> becomes
            <code class="literal">0x616263</code>). The affected data types are
            <a class="link" href="data-types.html#binary-varbinary" title="11.3.3 The BINARY and VARBINARY Types"><code class="literal">BINARY</code></a>,
            <a class="link" href="data-types.html#binary-varbinary" title="11.3.3 The BINARY and VARBINARY Types"><code class="literal">VARBINARY</code></a>,
            <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> types,
            <a class="link" href="data-types.html#bit-type" title="11.1.5 Bit-Value Type - BIT"><code class="literal">BIT</code></a>, all spatial data types,
            and other non-binary data types when used with the
            <a class="link" href="charset.html#charset-binary-set" title="10.10.8 The Binary Character Set"><code class="literal">binary</code>
            character set</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_host"></a>
            <a class="indexterm" name="idm46444423865520"></a>

            <a class="indexterm" name="idm46444423864064"></a>

            <a class="link" href="programs.html#option_mysqlpump_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Dump data from the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_include-databases"></a>
            <a class="indexterm" name="idm46444423858896"></a>

            <a class="indexterm" name="idm46444423857440"></a>

            <a class="link" href="programs.html#option_mysqlpump_include-databases"><code class="option">--include-databases=<em class="replaceable"><code>db_list</code></em></code></a>
          </p><p>
            Dump the databases in <em class="replaceable"><code>db_list</code></em>,
            which is a list of one or more comma-separated database
            names. The dump includes all objects in the named databases.
            Multiple instances of this option are additive. For more
            information, see <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_include-events"></a>
            <a class="indexterm" name="idm46444423851696"></a>

            <a class="indexterm" name="idm46444423850208"></a>

            <a class="link" href="programs.html#option_mysqlpump_include-events"><code class="option">--include-events=<em class="replaceable"><code>event_list</code></em></code></a>
          </p><p>
            Dump the events in <em class="replaceable"><code>event_list</code></em>,
            which is a list of one or more comma-separated event names.
            Multiple instances of this option are additive. For more
            information, see <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_include-routines"></a>
            <a class="indexterm" name="idm46444423844592"></a>

            <a class="indexterm" name="idm46444423843104"></a>

            <a class="link" href="programs.html#option_mysqlpump_include-routines"><code class="option">--include-routines=<em class="replaceable"><code>routine_list</code></em></code></a>
          </p><p>
            Dump the routines in
            <em class="replaceable"><code>routine_list</code></em>, which is a list of
            one or more comma-separated routine (stored procedure or
            function) names. Multiple instances of this option are
            additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_include-tables"></a>
            <a class="indexterm" name="idm46444423837424"></a>

            <a class="indexterm" name="idm46444423835936"></a>

            <a class="link" href="programs.html#option_mysqlpump_include-tables"><code class="option">--include-tables=<em class="replaceable"><code>table_list</code></em></code></a>
          </p><p>
            Dump the tables in <em class="replaceable"><code>table_list</code></em>,
            which is a list of one or more comma-separated table names.
            Multiple instances of this option are additive. For more
            information, see <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_include-triggers"></a>
            <a class="indexterm" name="idm46444423830320"></a>

            <a class="indexterm" name="idm46444423828832"></a>

            <a class="link" href="programs.html#option_mysqlpump_include-triggers"><code class="option">--include-triggers=<em class="replaceable"><code>trigger_list</code></em></code></a>
          </p><p>
            Dump the triggers in
            <em class="replaceable"><code>trigger_list</code></em>, which is a list of
            one or more comma-separated trigger names. Multiple
            instances of this option are additive. For more information,
            see <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_include-users"></a>
            <a class="indexterm" name="idm46444423823200"></a>

            <a class="indexterm" name="idm46444423821712"></a>

            <a class="link" href="programs.html#option_mysqlpump_include-users"><code class="option">--include-users=<em class="replaceable"><code>user_list</code></em></code></a>
          </p><p>
            Dump the user accounts in
            <em class="replaceable"><code>user_list</code></em>, which is a list of one
            or more comma-separated user names. Multiple instances of
            this option are additive. For more information, see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_insert-ignore"></a>
            <a class="indexterm" name="idm46444423816080"></a>

            <a class="indexterm" name="idm46444423814592"></a>

            <a class="link" href="programs.html#option_mysqlpump_insert-ignore"><code class="option">--insert-ignore</code></a>
          </p><p>
            Write <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT
            IGNORE</code></a> statements rather than
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_log-error-file"></a>
            <a class="indexterm" name="idm46444423808064"></a>

            <a class="indexterm" name="idm46444423806576"></a>

            <a class="link" href="programs.html#option_mysqlpump_log-error-file"><code class="option">--log-error-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Log warnings and errors by appending them to the named file.
            If this option is not given, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>
            writes warnings and errors to the standard error output.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_login-path"></a>
            <a class="indexterm" name="idm46444423800864"></a>

            <a class="indexterm" name="idm46444423799376"></a>

            <a class="link" href="programs.html#option_mysqlpump_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_max-allowed-packet"></a>
            <a class="indexterm" name="idm46444423790464"></a>

            <a class="indexterm" name="idm46444423789008"></a>

            <a class="link" href="programs.html#option_mysqlpump_max-allowed-packet"><code class="option">--max-allowed-packet=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            The maximum size of the buffer for client/server
            communication. The default is 24MB, the maximum is 1GB.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_net-buffer-length"></a>
            <a class="indexterm" name="idm46444423784528"></a>

            <a class="indexterm" name="idm46444423783072"></a>

            <a class="link" href="programs.html#option_mysqlpump_net-buffer-length"><code class="option">--net-buffer-length=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            The initial size of the buffer for client/server
            communication. When creating multiple-row
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements (as with
            the <a class="link" href="programs.html#option_mysqlpump_extended-insert"><code class="option">--extended-insert</code></a>
            option), <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> creates rows up to
            <em class="replaceable"><code>N</code></em> bytes long. If you use this
            option to increase the value, ensure that the MySQL server
            <a class="link" href="server-administration.html#sysvar_net_buffer_length"><code class="literal">net_buffer_length</code></a> system
            variable has a value at least this large.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_no-create-db"></a>
            <a class="indexterm" name="idm46444423773216"></a>

            <a class="indexterm" name="idm46444423771728"></a>

            <a class="link" href="programs.html#option_mysqlpump_no-create-db"><code class="option">--no-create-db</code></a>
          </p><p>
            Suppress any <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE DATABASE</code></a>
            statements that might otherwise be included in the output.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_no-create-info"></a>
            <a class="indexterm" name="idm46444423766320"></a>

            <a class="indexterm" name="idm46444423764832"></a>

            <a class="link" href="programs.html#option_mysqlpump_no-create-info"><code class="option">--no-create-info</code></a>,
            <code class="option">-t</code>
          </p><p>
            Do not write <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a>
            statements that create each dumped table.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_no-defaults"></a>
            <a class="indexterm" name="idm46444423759024"></a>

            <a class="indexterm" name="idm46444423757536"></a>

            <a class="link" href="programs.html#option_mysqlpump_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqlpump_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqlpump_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_parallel-schemas"></a>
            <a class="indexterm" name="idm46444423746208"></a>

            <a class="indexterm" name="idm46444423744720"></a>

            <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas=[<em class="replaceable"><code>N</code></em>:]<em class="replaceable"><code>db_list</code></em></code></a>
          </p><p>
            Create a queue for processing the databases in
            <em class="replaceable"><code>db_list</code></em>, which is a list of one
            or more comma-separated database names. If
            <em class="replaceable"><code>N</code></em> is given, the queue uses
            <em class="replaceable"><code>N</code></em> threads. If
            <em class="replaceable"><code>N</code></em> is not given, the
            <a class="link" href="programs.html#option_mysqlpump_default-parallelism"><code class="option">--default-parallelism</code></a>
            option determines the number of queue threads.
          </p><p>
            Multiple instances of this option create multiple queues.
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> also creates a default queue to
            use for databases not named in any
            <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas</code></a> option,
            and for dumping user definitions if command options select
            them. For more information, see
            <a class="xref" href="programs.html#mysqlpump-parallelism" title="mysqlpump Parallel Processing">mysqlpump Parallel Processing</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_password"></a>
            <a class="indexterm" name="idm46444423733504"></a>

            <a class="indexterm" name="idm46444423732016"></a>

            <a class="link" href="programs.html#option_mysqlpump_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqlpump_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> should not prompt for one, use
            the
            <a class="link" href="programs.html#option_mysqlpump_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_plugin-dir"></a>
            <a class="indexterm" name="idm46444423719248"></a>

            <a class="indexterm" name="idm46444423717760"></a>

            <a class="link" href="programs.html#option_mysqlpump_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqlpump_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_port"></a>
            <a class="indexterm" name="idm46444423710272"></a>

            <a class="indexterm" name="idm46444423708816"></a>

            <a class="link" href="programs.html#option_mysqlpump_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_print-defaults"></a>
            <a class="indexterm" name="idm46444423703776"></a>

            <a class="indexterm" name="idm46444423702288"></a>

            <a class="link" href="programs.html#option_mysqlpump_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_protocol"></a>
            <a class="indexterm" name="idm46444423696992"></a>

            <a class="indexterm" name="idm46444423695504"></a>

            <a class="link" href="programs.html#option_mysqlpump_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_replace"></a>
            <a class="indexterm" name="idm46444423690512"></a>

            <a class="indexterm" name="idm46444423689024"></a>

            <a class="link" href="programs.html#option_mysqlpump_replace"><code class="option">--replace</code></a>
          </p><p>
            Write <a class="link" href="sql-statements.html#replace" title="13.2.9 REPLACE Statement"><code class="literal">REPLACE</code></a> statements
            rather than <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_result-file"></a>
            <a class="indexterm" name="idm46444423682496"></a>

            <a class="indexterm" name="idm46444423681008"></a>

            <a class="link" href="programs.html#option_mysqlpump_result-file"><code class="option">--result-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Direct output to the named file. The result file is created
            and its previous contents overwritten, even if an error
            occurs while generating the dump.
          </p><p>
            This option should be used on Windows to prevent newline
            <code class="literal">\n</code> characters from being converted to
            <code class="literal">\r\n</code> carriage return/newline sequences.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_routines"></a>
            <a class="indexterm" name="idm46444423674496"></a>

            <a class="indexterm" name="idm46444423673008"></a>

            <a class="link" href="programs.html#option_mysqlpump_routines"><code class="option">--routines</code></a>
          </p><p>
            Include stored routines (procedures and functions) for the
            dumped databases in the output. This option requires the
            global <a class="link" href="security.html#priv_select"><code class="literal">SELECT</code></a> privilege.
          </p><p>
            The output generated by using
            <a class="link" href="programs.html#option_mysqlpump_routines"><code class="option">--routines</code></a> contains
            <a class="link" href="sql-statements.html#create-procedure" title="13.1.17 CREATE PROCEDURE and CREATE FUNCTION Statements"><code class="literal">CREATE PROCEDURE</code></a> and
            <a class="link" href="sql-statements.html#create-function" title="13.1.14 CREATE FUNCTION Statement"><code class="literal">CREATE FUNCTION</code></a> statements to
            create the routines.
          </p><p>
            This option is enabled by default; use
            <a class="link" href="programs.html#option_mysqlpump_routines"><code class="option">--skip-routines</code></a>
            to disable it.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_server-public-key-path"></a>
            <a class="indexterm" name="idm46444423662176"></a>

            <a class="indexterm" name="idm46444423660720"></a>

            <a class="link" href="programs.html#option_mysqlpump_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlpump_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlpump_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_set-charset"></a>
            <a class="indexterm" name="idm46444423647008"></a>

            <a class="indexterm" name="idm46444423645520"></a>

            <a class="link" href="programs.html#option_mysqlpump_set-charset"><code class="option">--set-charset</code></a>
          </p><p>
            Write <a class="link" href="sql-statements.html#set-names" title="13.7.6.3 SET NAMES Statement"><code class="literal">SET NAMES
            <em class="replaceable"><code>default_character_set</code></em></code></a>
            to the output.
          </p><p>
            This option is enabled by default. To disable it and
            suppress the <a class="link" href="sql-statements.html#set-names" title="13.7.6.3 SET NAMES Statement"><code class="literal">SET NAMES</code></a>
            statement, use
            <a class="link" href="programs.html#option_mysqlpump_set-charset"><code class="option">--skip-set-charset</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_set-gtid-purged"></a>
            <a class="indexterm" name="idm46444423637200"></a>

            <a class="indexterm" name="idm46444423635712"></a>

            <code class="option">--set-gtid-purged=<em class="replaceable"><code>value</code></em></code>
          </p><p>
            This option enables control over global transaction ID
            (GTID) information written to the dump file, by indicating
            whether to add a
            <a class="link" href="sql-statements.html#set-variable" title="13.7.6.1 SET Syntax for Variable Assignment"><code class="literal">SET
            @@GLOBAL.gtid_purged</code></a> statement to the output. This
            option may also cause a statement to be written to the
            output that disables binary logging while the dump file is
            being reloaded.
          </p><p>
            The following table shows the permitted option values. The
            default value is <code class="literal">AUTO</code>.
</p>
<div class="informaltable">
<table summary="Permitted option values for the mysqlpump --set-gtid-purged option."><col width="10%"><col width="90%"><thead><tr>
                <th scope="col">Value</th>
                <th scope="col">Meaning</th>
              </tr></thead><tbody><tr>
                <td scope="row"><code class="literal">OFF</code></td>
                <td>Add no <code class="literal">SET</code> statement to the output.</td>
              </tr><tr>
                <td scope="row"><code class="literal">ON</code></td>
                <td>Add a <code class="literal">SET</code> statement to the output. An error occurs if
                  GTIDs are not enabled on the server.</td>
              </tr><tr>
                <td scope="row"><code class="literal">AUTO</code></td>
                <td>Add a <code class="literal">SET</code> statement to the output if GTIDs are
                  enabled on the server.</td>
</tr></tbody></table>
</div>
<p>
            The <code class="option">--set-gtid-purged</code> option has the
            following effect on binary logging when the dump file is
            reloaded:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="option">--set-gtid-purged=OFF</code>: <code class="literal">SET
                @@SESSION.SQL_LOG_BIN=0;</code> is not added to the
                output.
              </p></li><li class="listitem"><p>
                <code class="option">--set-gtid-purged=ON</code>: <code class="literal">SET
                @@SESSION.SQL_LOG_BIN=0;</code> is added to the
                output.
              </p></li><li class="listitem"><p>
                <code class="option">--set-gtid-purged=AUTO</code>: <code class="literal">SET
                @@SESSION.SQL_LOG_BIN=0;</code> is added to the
                output if GTIDs are enabled on the server you are
                backing up (that is, if <code class="literal">AUTO</code>
                evaluates to <code class="literal">ON</code>).
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_mysqlpump_single-transaction"></a>
            <a class="indexterm" name="idm46444423604096"></a>

            <a class="indexterm" name="idm46444423602640"></a>

            <a class="link" href="programs.html#option_mysqlpump_single-transaction"><code class="option">--single-transaction</code></a>
          </p><p>
            This option sets the transaction isolation mode to
            <a class="link" href="innodb-storage-engine.html#isolevel_repeatable-read"><code class="literal">REPEATABLE READ</code></a> and sends
            a <a class="link" href="sql-statements.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"><code class="literal">START
            TRANSACTION</code></a> SQL statement to the server before
            dumping data. It is useful only with transactional tables
            such as <code class="literal">InnoDB</code>, because then it dumps the
            consistent state of the database at the time when
            <a class="link" href="sql-statements.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"><code class="literal">START
            TRANSACTION</code></a> was issued without blocking any
            applications.
          </p><p>
            When using this option, you should keep in mind that only
            <code class="literal">InnoDB</code> tables are dumped in a consistent
            state. For example, any <code class="literal">MyISAM</code> or
            <code class="literal">MEMORY</code> tables dumped while using this
            option may still change state.
          </p><p>
            While a
            <a class="link" href="programs.html#option_mysqlpump_single-transaction"><code class="option">--single-transaction</code></a> dump
            is in process, to ensure a valid dump file (correct table
            contents and binary log coordinates), no other connection
            should use the following statements:
            <a class="link" href="sql-statements.html#alter-table" title="13.1.9 ALTER TABLE Statement"><code class="literal">ALTER TABLE</code></a>,
            <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TABLE</code></a>,
            <a class="link" href="sql-statements.html#drop-table" title="13.1.32 DROP TABLE Statement"><code class="literal">DROP TABLE</code></a>,
            <a class="link" href="sql-statements.html#rename-table" title="13.1.36 RENAME TABLE Statement"><code class="literal">RENAME TABLE</code></a>,
            <a class="link" href="sql-statements.html#truncate-table" title="13.1.37 TRUNCATE TABLE Statement"><code class="literal">TRUNCATE TABLE</code></a>. A consistent
            read is not isolated from those statements, so use of them
            on a table to be dumped can cause the
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> that is performed by
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> to retrieve the table contents
            to obtain incorrect contents or fail.
          </p><p>
            <a class="link" href="programs.html#option_mysqlpump_add-locks"><code class="option">--add-locks</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_single-transaction"><code class="option">--single-transaction</code></a> are
            mutually exclusive.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_skip-definer"></a>
            <a class="indexterm" name="idm46444423578064"></a>

            <a class="indexterm" name="idm46444423576576"></a>

            <a class="link" href="programs.html#option_mysqlpump_skip-definer"><code class="option">--skip-definer</code></a>
          </p><p>
            Omit <code class="literal">DEFINER</code> and <code class="literal">SQL
            SECURITY</code> clauses from the
            <code class="literal">CREATE</code> statements for views and stored
            programs. The dump file, when reloaded, creates objects that
            use the default <code class="literal">DEFINER</code> and <code class="literal">SQL
            SECURITY</code> values. See
            <a class="xref" href="stored-objects.html#stored-objects-security" title="24.6 Stored Object Access Control">Section 24.6, “Stored Object Access Control”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_skip-dump-rows"></a>
            <a class="indexterm" name="idm46444423567984"></a>

            <a class="indexterm" name="idm46444423566496"></a>

            <a class="link" href="programs.html#option_mysqlpump_skip-dump-rows"><code class="option">--skip-dump-rows</code></a>,
            <code class="option">-d</code>
          </p><p>
            Do not dump table rows.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_socket"></a>
            <a class="indexterm" name="idm46444423561952"></a>

            <a class="indexterm" name="idm46444423560496"></a>

            <a class="link" href="programs.html#option_mysqlpump_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_ssl"></a>
            <a class="indexterm" name="idm46444423551488"></a>

            <a class="indexterm" name="idm46444423550032"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqlpump_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444423544144"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqlpump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqlpump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqlpump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqlpump_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlpump_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444423527088"></a>

            <a class="indexterm" name="idm46444423525600"></a>

            <a class="link" href="programs.html#option_mysqlpump_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_tls-version"></a>
            <a class="indexterm" name="idm46444423519792"></a>

            <a class="indexterm" name="idm46444423518304"></a>

            <a class="link" href="programs.html#option_mysqlpump_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_triggers"></a>
            <a class="indexterm" name="idm46444423512928"></a>

            <a class="indexterm" name="idm46444423511440"></a>

            <a class="link" href="programs.html#option_mysqlpump_triggers"><code class="option">--triggers</code></a>
          </p><p>
            Include triggers for each dumped table in the output.
          </p><p>
            This option is enabled by default; use
            <a class="link" href="programs.html#option_mysqlpump_triggers"><code class="option">--skip-triggers</code></a>
            to disable it.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_tz-utc"></a>
            <a class="indexterm" name="idm46444423505856"></a>

            <a class="indexterm" name="idm46444423504400"></a>

            <a class="link" href="programs.html#option_mysqlpump_tz-utc"><code class="option">--tz-utc</code></a>
          </p><p>
            This option enables <a class="link" href="data-types.html#datetime" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a>
            columns to be dumped and reloaded between servers in
            different time zones. <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> sets its
            connection time zone to UTC and adds <code class="literal">SET
            TIME_ZONE='+00:00'</code> to the dump file. Without this
            option, <a class="link" href="data-types.html#datetime" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> columns are
            dumped and reloaded in the time zones local to the source
            and destination servers, which can cause the values to
            change if the servers are in different time zones.
            <a class="link" href="programs.html#option_mysqlpump_tz-utc"><code class="option">--tz-utc</code></a> also protects
            against changes due to daylight saving time.
          </p><p>
            This option is enabled by default; use
            <a class="link" href="programs.html#option_mysqlpump_tz-utc"><code class="option">--skip-tz-utc</code></a>
            to disable it.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_user"></a>
            <a class="indexterm" name="idm46444423493056"></a>

            <a class="indexterm" name="idm46444423491600"></a>

            <a class="link" href="programs.html#option_mysqlpump_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_users"></a>
            <a class="indexterm" name="idm46444423486448"></a>

            <a class="indexterm" name="idm46444423484992"></a>

            <a class="link" href="programs.html#option_mysqlpump_users"><code class="option">--users</code></a>
          </p><p>
            Dump user accounts as logical definitions in the form of
            <a class="link" href="sql-statements.html#create-user" title="13.7.1.3 CREATE USER Statement"><code class="literal">CREATE USER</code></a> and
            <a class="link" href="sql-statements.html#grant" title="13.7.1.6 GRANT Statement"><code class="literal">GRANT</code></a> statements.
          </p><p>
            User definitions are stored in the grant tables in the
            <code class="literal">mysql</code> system database. By default,
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not include the grant
            tables in <code class="literal">mysql</code> database dumps. To dump
            the contents of the grant tables as logical definitions, use
            the <a class="link" href="programs.html#option_mysqlpump_users"><code class="option">--users</code></a> option and
            suppress all database dumping:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --exclude-databases=% --users</code></strong>
</pre></li><li class="listitem"><p><a name="option_mysqlpump_version"></a>
            <a class="indexterm" name="idm46444423472368"></a>

            <a class="indexterm" name="idm46444423470880"></a>

            <a class="link" href="programs.html#option_mysqlpump_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_watch-progress"></a>
            <a class="indexterm" name="idm46444423466384"></a>

            <a class="indexterm" name="idm46444423464896"></a>

            <a class="link" href="programs.html#option_mysqlpump_watch-progress"><code class="option">--watch-progress</code></a>
          </p><p>
            Periodically display a progress indicator that provides
            information about the completed and total number of tables,
            rows, and other objects.
          </p><p>
            This option is enabled by default; use
            <a class="link" href="programs.html#option_mysqlpump_watch-progress"><code class="option">--skip-watch-progress</code></a>
            to disable it.
          </p></li><li class="listitem"><p><a name="option_mysqlpump_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqlpump_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444423457872"></a><a class="indexterm" name="idm46444423456368"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>
<h4><a name="mysqlpump-filtering"></a>mysqlpump Object Selection</h4>
<a class="indexterm" name="idm46444423448928"></a><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> has a set of inclusion and
        exclusion options that enable filtering of several object types
        and provide flexible control over which objects to dump:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_include-databases"><code class="option">--include-databases</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_exclude-databases"><code class="option">--exclude-databases</code></a> apply
            to databases and all objects within them.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_include-tables"><code class="option">--include-tables</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_exclude-tables"><code class="option">--exclude-tables</code></a> apply to
            tables. These options also affect triggers associated with
            tables unless the trigger-specific options are given.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_include-triggers"><code class="option">--include-triggers</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_exclude-triggers"><code class="option">--exclude-triggers</code></a> apply
            to triggers.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_include-routines"><code class="option">--include-routines</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_exclude-routines"><code class="option">--exclude-routines</code></a> apply
            to stored procedures and functions. If a routine option
            matches a stored procedure name, it also matches a stored
            function of the same name.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_include-events"><code class="option">--include-events</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_exclude-events"><code class="option">--exclude-events</code></a> apply to
            Event Scheduler events.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_include-users"><code class="option">--include-users</code></a> and
            <a class="link" href="programs.html#option_mysqlpump_exclude-users"><code class="option">--exclude-users</code></a> apply to
            user accounts.
</p></li></ul>
</div>
<p>
        Any inclusion or exclusion option may be given multiple times.
        The effect is additive. Order of these options does not matter.
      </p><p>
        The value of each inclusion and exclusion option is a list of
        comma-separated names of the appropriate object type. For
        example:
      </p><pre data-lang="terminal" class="programlisting">--exclude-databases=test,world
--include-tables=customer,invoice</pre><p>
        Wildcard characters are permitted in the object names:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">%</code> matches any sequence of zero or more
            characters.
          </p></li><li class="listitem"><p>
            <code class="literal">_</code> matches any single character.
</p></li></ul>
</div>
<p>
        For example,
        <a class="link" href="programs.html#option_mysqlpump_include-tables"><code class="option">--include-tables=t%,__tmp</code></a>
        matches all table names that begin with <code class="literal">t</code> and
        all five-character table names that end with
        <code class="literal">tmp</code>.
      </p><p>
        For users, a name specified without a host part is interpreted
        with an implied host of <code class="literal">%</code>. For example,
        <code class="literal">u1</code> and <code class="literal">u1@%</code> are
        equivalent. This is the same equivalence that applies in MySQL
        generally (see <a class="xref" href="security.html#account-names" title="6.2.4 Specifying Account Names">Section 6.2.4, “Specifying Account Names”</a>).
      </p><p>
        Inclusion and exclusion options interact as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            By default, with no inclusion or exclusion options,
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> dumps all databases (with
            certain exceptions noted in
            <a class="xref" href="programs.html#mysqlpump-restrictions" title="mysqlpump Restrictions">mysqlpump Restrictions</a>).
          </p></li><li class="listitem"><p>
            If inclusion options are given in the absence of exclusion
            options, only the objects named as included are dumped.
          </p></li><li class="listitem"><p>
            If exclusion options are given in the absence of inclusion
            options, all objects are dumped except those named as
            excluded.
          </p></li><li class="listitem"><p>
            If inclusion and exclusion options are given, all objects
            named as excluded and not named as included are not dumped.
            All other objects are dumped.
</p></li></ul>
</div>
<p>
        If multiple databases are being dumped, it is possible to name
        tables, triggers, and routines in a specific database by
        qualifying the object names with the database name. The
        following command dumps databases <code class="literal">db1</code> and
        <code class="literal">db2</code>, but excludes tables
        <code class="literal">db1.t1</code> and <code class="literal">db2.t2</code>:

</p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --include-databases=db1,db2 --exclude-tables=db1.t1,db2.t2</code></strong>
</pre><p>
      </p><p>
        The following options provide alternative ways to specify which
        databases to dump:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a> option
            dumps all databases (with certain exceptions noted in
            <a class="xref" href="programs.html#mysqlpump-restrictions" title="mysqlpump Restrictions">mysqlpump Restrictions</a>). It is equivalent
            to specifying no object options at all (the default
            <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> action is to dump everything).
          </p><p>
            <a class="link" href="programs.html#option_mysqlpump_include-databases"><code class="option">--include-databases=%</code></a> is
            similar to
            <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a>, but
            selects all databases for dumping, even those that are
            exceptions for
            <a class="link" href="programs.html#option_mysqlpump_all-databases"><code class="option">--all-databases</code></a>.
          </p></li><li class="listitem"><p>
            The <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> option
            causes <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> to treat all name
            arguments as names of databases to dump. It is equivalent to
            an <a class="link" href="programs.html#option_mysqlpump_include-databases"><code class="option">--include-databases</code></a>
            option that names the same databases.
</p></li></ul>
</div>
<h4><a name="mysqlpump-parallelism"></a>mysqlpump Parallel Processing</h4>
<a class="indexterm" name="idm46444423390672"></a><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> can use parallelism to achieve
        concurrent processing. You can select concurrency between
        databases (to dump multiple databases simultaneously) and within
        databases (to dump multiple objects from a given database
        simultaneously).
      </p><p>
        By default, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> sets up one queue with
        two threads. You can create additional queues and control the
        number of threads assigned to each one, including the default
        queue:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_default-parallelism"><code class="option">--default-parallelism=<em class="replaceable"><code>N</code></em></code></a>
            specifies the default number of threads used for each queue.
            In the absence of this option, <em class="replaceable"><code>N</code></em>
            is 2.
          </p><p>
            The default queue always uses the default number of threads.
            Additional queues use the default number of threads unless
            you specify otherwise.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas=[<em class="replaceable"><code>N</code></em>:]<em class="replaceable"><code>db_list</code></em></code></a>
            sets up a processing queue for dumping the databases named
            in <em class="replaceable"><code>db_list</code></em> and optionally
            specifies how many threads the queue uses.
            <em class="replaceable"><code>db_list</code></em> is a list of
            comma-separated database names. If the option argument
            begins with
            <code class="literal"><em class="replaceable"><code>N</code></em>:</code>, the queue
            uses <em class="replaceable"><code>N</code></em> threads. Otherwise, the
            <a class="link" href="programs.html#option_mysqlpump_default-parallelism"><code class="option">--default-parallelism</code></a>
            option determines the number of queue threads.
          </p><p>
            Multiple instances of the
            <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas</code></a> option
            create multiple queues.
          </p><p>
            Names in the database list are permitted to contain the same
            <code class="literal">%</code> and <code class="literal">_</code> wildcard
            characters supported for filtering options (see
            <a class="xref" href="programs.html#mysqlpump-filtering" title="mysqlpump Object Selection">mysqlpump Object Selection</a>).
</p></li></ul>
</div>
<p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> uses the default queue for
        processing any databases not named explicitly with a
        <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas</code></a> option, and
        for dumping user definitions if command options select them.
      </p><p>
        In general, with multiple queues, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a>
        uses parallelism between the sets of databases processed by the
        queues, to dump multiple databases simultaneously. For a queue
        that uses multiple threads, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> uses
        parallelism within databases, to dump multiple objects from a
        given database simultaneously. Exceptions can occur; for
        example, <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> may block queues while it
        obtains from the server lists of objects in databases.
      </p><p>
        With parallelism enabled, it is possible for output from
        different databases to be interleaved. For example,
        <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements from multiple
        tables dumped in parallel can be interleaved; the statements are
        not written in any particular order. This does not affect
        reloading because output statements qualify object names with
        database names or are preceded by
        <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a> statements as required.
      </p><p>
        The granularity for parallelism is a single database object. For
        example, a single table cannot be dumped in parallel using
        multiple threads.
      </p><p>
        Examples:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --parallel-schemas=db1,db2 --parallel-schemas=db3</code></strong>
</pre><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> sets up a queue to process
        <code class="literal">db1</code> and <code class="literal">db2</code>, another queue
        to process <code class="literal">db3</code>, and a default queue to
        process all other databases. All queues use two threads.
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --parallel-schemas=db1,db2 --parallel-schemas=db3</code></strong>
         <strong class="userinput"><code>--default-parallelism=4</code></strong>
</pre><p>
        This is the same as the previous example except that all queues
        use four threads.
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --parallel-schemas=5:db1,db2 --parallel-schemas=3:db3</code></strong>
</pre><p>
        The queue for <code class="literal">db1</code> and <code class="literal">db2</code>
        uses five threads, the queue for <code class="literal">db3</code> uses
        three threads, and the default queue uses the default of two
        threads.
      </p><p>
        As a special case, with
        <a class="link" href="programs.html#option_mysqlpump_default-parallelism"><code class="option">--default-parallelism=0</code></a> and no
        <a class="link" href="programs.html#option_mysqlpump_parallel-schemas"><code class="option">--parallel-schemas</code></a> options,
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> runs as a single-threaded process
        and creates no queues.
</p>
<h4><a name="mysqlpump-restrictions"></a>mysqlpump Restrictions</h4>
<a class="indexterm" name="idm46444423342976"></a><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not dump the
        <code class="literal">performance_schema</code>,
        <code class="literal">ndbinfo</code>, or <code class="literal">sys</code> schema by
        default. To dump any of these, name them explicitly on the
        command line. You can also name them with the
        <a class="link" href="programs.html#option_mysqlpump_databases"><code class="option">--databases</code></a> or
        <a class="link" href="programs.html#option_mysqlpump_include-databases"><code class="option">--include-databases</code></a> option.
      </p><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not dump the
        <code class="literal">INFORMATION_SCHEMA</code> schema.
      </p><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> does not dump
        <code class="literal">InnoDB</code> <a class="link" href="sql-statements.html#create-tablespace" title="13.1.21 CREATE TABLESPACE Statement"><code class="literal">CREATE
        TABLESPACE</code></a> statements.
      </p><p>
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> dumps user accounts in logical form
        using <a class="link" href="sql-statements.html#create-user" title="13.7.1.3 CREATE USER Statement"><code class="literal">CREATE USER</code></a> and
        <a class="link" href="sql-statements.html#grant" title="13.7.1.6 GRANT Statement"><code class="literal">GRANT</code></a> statements (for example,
        when you use the
        <a class="link" href="programs.html#option_mysqlpump_include-users"><code class="option">--include-users</code></a> or
        <a class="link" href="programs.html#option_mysqlpump_users"><code class="option">--users</code></a> option). For this
        reason, dumps of the <code class="literal">mysql</code> system database do
        not by default include the grant tables that contain user
        definitions: <code class="literal">user</code>, <code class="literal">db</code>,
        <code class="literal">tables_priv</code>, <code class="literal">columns_priv</code>,
        <code class="literal">procs_priv</code>, or
        <code class="literal">proxies_priv</code>. To dump any of the grant
        tables, name the <code class="literal">mysql</code> database followed by
        the table names:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump mysql user db ...</code></strong>
</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqlshow"></a>4.5.7 <span class="command"><strong>mysqlshow</strong></span> — Display Database, Table, and Column Information</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444423314272"></a><a class="indexterm" name="idm46444423313328"></a><a class="indexterm" name="idm46444423311968"></a><a class="indexterm" name="idm46444423310608"></a><a class="indexterm" name="idm46444423309248"></a><a class="indexterm" name="idm46444423307888"></a><p>
        The <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> client can be used to quickly
        see which databases exist, their tables, or a table's columns or
        indexes.
      </p><p>
        <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> provides a command-line interface
        to several SQL <a class="link" href="sql-statements.html#show" title="13.7.7 SHOW Statements"><code class="literal">SHOW</code></a> statements.
        See <a class="xref" href="sql-statements.html#show" title="13.7.7 SHOW Statements">Section 13.7.7, “SHOW Statements”</a>. The same information can be obtained
        by using those statements directly. For example, you can issue
        them from the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client program.
      </p><p>
        Invoke <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlshow [<em class="replaceable"><code>options</code></em>] [<em class="replaceable"><code>db_name</code></em> [<em class="replaceable"><code>tbl_name</code></em> [<em class="replaceable"><code>col_name</code></em>]]]</code></strong>
</pre>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            If no database is given, a list of database names is shown.
          </p></li><li class="listitem"><p>
            If no table is given, all matching tables in the database
            are shown.
          </p></li><li class="listitem"><p>
            If no column is given, all matching columns and column types
            in the table are shown.
</p></li></ul>
</div>
<p>
        The output displays only the names of those databases, tables,
        or columns for which you have some privileges.
      </p><p>
        If the last argument contains shell or SQL wildcard characters
        (<code class="literal">*</code>, <code class="literal">?</code>,
        <code class="literal">%</code>, or <code class="literal">_</code>), only those names
        that are matched by the wildcard are shown. If a database name
        contains any underscores, those should be escaped with a
        backslash (some Unix shells require two) to get a list of the
        proper tables or columns. <code class="literal">*</code> and
        <code class="literal">?</code> characters are converted into SQL
        <code class="literal">%</code> and <code class="literal">_</code> wildcard
        characters. This might cause some confusion when you try to
        display the columns for a table with a <code class="literal">_</code> in
        the name, because in this case, <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a>
        shows you only the table names that match the pattern. This is
        easily fixed by adding an extra <code class="literal">%</code> last on the
        command line as a separate argument.
      </p><p>
        <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqlshow]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444423278096"></a><p class="title"><b>Table 4.17 mysqlshow Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqlshow."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_count">--count</a></td>
<td>Show the number of rows per table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_default-character-set">--default-character-set</a></td>
<td>Specify default character set</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_keys">--keys</a></td>
<td>Show table indexes</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_show-table-type">--show-table-type</a></td>
<td>Show a column indicating the table type</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_status">--status</a></td>
<td>Display extra information about each table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlshow_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqlshow_help"></a>
            <a class="indexterm" name="idm46444423066032"></a>

            <a class="indexterm" name="idm46444423064576"></a>

            <a class="link" href="programs.html#option_mysqlshow_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_bind-address"></a>
            <a class="indexterm" name="idm46444423060000"></a>

            <a class="indexterm" name="idm46444423058512"></a>

            <a class="link" href="programs.html#option_mysqlshow_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_character-sets-dir"></a>
            <a class="indexterm" name="idm46444423053984"></a>

            <a class="indexterm" name="idm46444423052528"></a>

            <a class="link" href="programs.html#option_mysqlshow_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_compress"></a>
            <a class="indexterm" name="idm46444423047280"></a>

            <a class="indexterm" name="idm46444423045792"></a>

            <a class="link" href="programs.html#option_mysqlshow_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqlshow_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444423037936"></a><a class="indexterm" name="idm46444423036432"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_count"></a>
            <a class="indexterm" name="idm46444423029552"></a>

            <a class="indexterm" name="idm46444423028096"></a>

            <a class="link" href="programs.html#option_mysqlshow_count"><code class="option">--count</code></a>
          </p><p>
            Show the number of rows per table. This can be slow for
            non-<code class="literal">MyISAM</code> tables.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_debug"></a>
            <a class="indexterm" name="idm46444423023296"></a>

            <a class="indexterm" name="idm46444423021840"></a>

            <a class="link" href="programs.html#option_mysqlshow_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is <code class="literal">d:t:o</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_debug-check"></a>
            <a class="indexterm" name="idm46444423012336"></a>

            <a class="indexterm" name="idm46444423010848"></a>

            <a class="link" href="programs.html#option_mysqlshow_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_debug-info"></a>
            <a class="indexterm" name="idm46444423004816"></a>

            <a class="indexterm" name="idm46444423003328"></a>

            <a class="link" href="programs.html#option_mysqlshow_debug-info"><code class="option">--debug-info</code></a>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_default-character-set"></a>
            <a class="indexterm" name="idm46444422997248"></a>

            <a class="indexterm" name="idm46444422995792"></a>

            <a class="link" href="programs.html#option_mysqlshow_default-character-set"><code class="option">--default-character-set=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Use <em class="replaceable"><code>charset_name</code></em> as the default
            character set. See <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_default-auth"></a>
            <a class="indexterm" name="idm46444422990240"></a>

            <a class="indexterm" name="idm46444422988752"></a>

            <a class="link" href="programs.html#option_mysqlshow_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444422983648"></a>

            <a class="indexterm" name="idm46444422982192"></a>

            <a class="link" href="programs.html#option_mysqlshow_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_defaults-file"></a>
            <a class="indexterm" name="idm46444422975856"></a>

            <a class="indexterm" name="idm46444422974368"></a>

            <a class="link" href="programs.html#option_mysqlshow_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444422966000"></a>

            <a class="indexterm" name="idm46444422964544"></a>

            <a class="link" href="programs.html#option_mysqlshow_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqlshow]</code> groups. If the
            <a class="link" href="programs.html#option_mysqlshow_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysqlshow_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444422952000"></a>

            <a class="indexterm" name="idm46444422950496"></a>

            <a class="link" href="programs.html#option_mysqlshow_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysqlshow_get-server-public-key"></a>
            <a class="indexterm" name="idm46444422944928"></a>

            <a class="indexterm" name="idm46444422943472"></a>

            <a class="link" href="programs.html#option_mysqlshow_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the RSA public key that it uses for
            key pair-based password exchange. This option applies to
            clients that connect to the server using an account that
            authenticates with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For connections by such accounts, the server does
            not send the public key to the client unless requested. The
            option is ignored for accounts that do not authenticate with
            that plugin. It is also ignored if RSA-based password
            exchange is not needed, as is the case when the client
            connects to the server using a secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlshow_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlshow_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_host"></a>
            <a class="indexterm" name="idm46444422933296"></a>

            <a class="indexterm" name="idm46444422931840"></a>

            <a class="link" href="programs.html#option_mysqlshow_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_keys"></a>
            <a class="indexterm" name="idm46444422926784"></a>

            <a class="indexterm" name="idm46444422925328"></a>

            <a class="link" href="programs.html#option_mysqlshow_keys"><code class="option">--keys</code></a>,
            <code class="option">-k</code>
          </p><p>
            Show table indexes.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_login-path"></a>
            <a class="indexterm" name="idm46444422920832"></a>

            <a class="indexterm" name="idm46444422919344"></a>

            <a class="link" href="programs.html#option_mysqlshow_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_no-defaults"></a>
            <a class="indexterm" name="idm46444422910496"></a>

            <a class="indexterm" name="idm46444422909008"></a>

            <a class="link" href="programs.html#option_mysqlshow_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqlshow_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqlshow_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_password"></a>
            <a class="indexterm" name="idm46444422897680"></a>

            <a class="indexterm" name="idm46444422896192"></a>

            <a class="link" href="programs.html#option_mysqlshow_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqlshow_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> should not prompt for one, use
            the
            <a class="link" href="programs.html#option_mysqlshow_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_pipe"></a>
            <a class="indexterm" name="idm46444422883472"></a>

            <a class="indexterm" name="idm46444422882016"></a>

            <a class="link" href="programs.html#option_mysqlshow_pipe"><code class="option">--pipe</code></a>,
            <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_plugin-dir"></a>
            <a class="indexterm" name="idm46444422874688"></a>

            <a class="indexterm" name="idm46444422873200"></a>

            <a class="link" href="programs.html#option_mysqlshow_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqlshow_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqlshow" title="4.5.7 mysqlshow — Display Database, Table, and Column Information"><span class="command"><strong>mysqlshow</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_port"></a>
            <a class="indexterm" name="idm46444422865776"></a>

            <a class="indexterm" name="idm46444422864320"></a>

            <a class="link" href="programs.html#option_mysqlshow_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_print-defaults"></a>
            <a class="indexterm" name="idm46444422859280"></a>

            <a class="indexterm" name="idm46444422857792"></a>

            <a class="link" href="programs.html#option_mysqlshow_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_protocol"></a>
            <a class="indexterm" name="idm46444422852496"></a>

            <a class="indexterm" name="idm46444422851008"></a>

            <a class="link" href="programs.html#option_mysqlshow_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_server-public-key-path"></a>
            <a class="indexterm" name="idm46444422846016"></a>

            <a class="indexterm" name="idm46444422844560"></a>

            <a class="link" href="programs.html#option_mysqlshow_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlshow_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlshow_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444422830688"></a>

            <a class="indexterm" name="idm46444422829232"></a>

            <a class="link" href="programs.html#option_mysqlshow_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_show-table-type"></a>
            <a class="indexterm" name="idm46444422822176"></a>

            <a class="indexterm" name="idm46444422820688"></a>

            <a class="link" href="programs.html#option_mysqlshow_show-table-type"><code class="option">--show-table-type</code></a>,
            <code class="option">-t</code>
          </p><p>
            Show a column indicating the table type, as in
            <a class="link" href="sql-statements.html#show-tables" title="13.7.7.37 SHOW TABLES Statement"><code class="literal">SHOW FULL
            TABLES</code></a>. The type is <code class="literal">BASE TABLE</code>
            or <code class="literal">VIEW</code>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_socket"></a>
            <a class="indexterm" name="idm46444422813472"></a>

            <a class="indexterm" name="idm46444422812016"></a>

            <a class="link" href="programs.html#option_mysqlshow_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_ssl"></a>
            <a class="indexterm" name="idm46444422802960"></a>

            <a class="indexterm" name="idm46444422801504"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqlshow_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444422795616"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqlshow_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqlshow_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqlshow_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqlshow_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlshow_status"></a>
            <a class="indexterm" name="idm46444422778496"></a>

            <a class="indexterm" name="idm46444422777040"></a>

            <a class="link" href="programs.html#option_mysqlshow_status"><code class="option">--status</code></a>,
            <code class="option">-i</code>
          </p><p>
            Display extra information about each table.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444422772576"></a>

            <a class="indexterm" name="idm46444422771088"></a>

            <a class="link" href="programs.html#option_mysqlshow_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_tls-version"></a>
            <a class="indexterm" name="idm46444422765216"></a>

            <a class="indexterm" name="idm46444422763728"></a>

            <a class="link" href="programs.html#option_mysqlshow_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_user"></a>
            <a class="indexterm" name="idm46444422758352"></a>

            <a class="indexterm" name="idm46444422756896"></a>

            <a class="link" href="programs.html#option_mysqlshow_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_verbose"></a>
            <a class="indexterm" name="idm46444422751744"></a>

            <a class="indexterm" name="idm46444422750256"></a>

            <a class="link" href="programs.html#option_mysqlshow_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does. This option can be used multiple times to increase the
            amount of information.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_version"></a>
            <a class="indexterm" name="idm46444422745568"></a>

            <a class="indexterm" name="idm46444422744080"></a>

            <a class="link" href="programs.html#option_mysqlshow_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlshow_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqlshow_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444422738240"></a><a class="indexterm" name="idm46444422736736"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqlslap"></a>4.5.8 <span class="command"><strong>mysqlslap</strong></span> — Load Emulation Client</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444422728736"></a><a class="indexterm" name="idm46444422727792"></a><p>
        <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> is a diagnostic program designed to
        emulate client load for a MySQL server and to report the timing
        of each stage. It works as if multiple clients are accessing the
        server.
      </p><p>
        Invoke <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlslap [<em class="replaceable"><code>options</code></em>]</code></strong>
</pre><p>
        Some options such as <a class="link" href="programs.html#option_mysqlslap_create"><code class="option">--create</code></a>
        or <a class="link" href="programs.html#option_mysqlslap_query"><code class="option">--query</code></a> enable you to
        specify a string containing an SQL statement or a file
        containing statements. If you specify a file, by default it must
        contain one statement per line. (That is, the implicit statement
        delimiter is the newline character.) Use the
        <a class="link" href="programs.html#option_mysqlslap_delimiter"><code class="option">--delimiter</code></a> option to specify
        a different delimiter, which enables you to specify statements
        that span multiple lines or place multiple statements on a
        single line. You cannot include comments in a file;
        <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> does not understand them.
      </p><p>
        <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> runs in three stages:
</p>
<div class="orderedlist">
<ol class="orderedlist" type="1"><li class="listitem"><p>
            Create schema, table, and optionally any stored programs or
            data to use for the test. This stage uses a single client
            connection.
          </p></li><li class="listitem"><p>
            Run the load test. This stage can use many client
            connections.
          </p></li><li class="listitem"><p>
            Clean up (disconnect, drop table if specified). This stage
            uses a single client connection.
</p></li></ol>
</div>
<p>
        Examples:
      </p><p>
        Supply your own create and query SQL statements, with 50 clients
        querying and 200 selects for each (enter the command on a single
        line):
      </p><pre data-lang="terminal" class="programlisting">mysqlslap --delimiter=";"
  --create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)"
  --query="SELECT * FROM a" --concurrency=50 --iterations=200</pre><p>
        Let <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> build the query SQL statement
        with a table of two <a class="link" href="data-types.html#integer-types" title="11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT"><code class="literal">INT</code></a> columns
        and three <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a> columns. Use
        five clients querying 20 times each. Do not create the table or
        insert the data (that is, use the previous test's schema and
        data):
      </p><pre data-lang="terminal" class="programlisting">mysqlslap --concurrency=5 --iterations=20
  --number-int-cols=2 --number-char-cols=3
  --auto-generate-sql</pre><p>
        Tell the program to load the create, insert, and query SQL
        statements from the specified files, where the
        <code class="filename">create.sql</code> file has multiple table creation
        statements delimited by <code class="literal">';'</code> and multiple
        insert statements delimited by <code class="literal">';'</code>. The
        <code class="option">--query</code> file will have multiple queries
        delimited by <code class="literal">';'</code>. Run all the load
        statements, then run all the queries in the query file with five
        clients (five times each):
      </p><pre data-lang="terminal" class="programlisting">mysqlslap --concurrency=5
  --iterations=5 --query=query.sql --create=create.sql
  --delimiter=";"</pre><p>
        <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqlslap]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444422694080"></a><p class="title"><b>Table 4.18 mysqlslap Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqlslap."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql">--auto-generate-sql</a></td>
<td>Generate SQL statements automatically when they are not supplied in files or using command options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-add-autoincrement">--auto-generate-sql-add-autoincrement</a></td>
<td>Add AUTO_INCREMENT column to automatically generated tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-execute-number">--auto-generate-sql-execute-number</a></td>
<td>Specify how many queries to generate automatically</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-guid-primary">--auto-generate-sql-guid-primary</a></td>
<td>Add a GUID-based primary key to automatically generated tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-load-type">--auto-generate-sql-load-type</a></td>
<td>Specify the test load type</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-secondary-indexes">--auto-generate-sql-secondary-indexes</a></td>
<td>Specify how many secondary indexes to add to automatically generated tables</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-unique-query-number">--auto-generate-sql-unique-query-number</a></td>
<td>How many different queries to generate for automatic tests</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-unique-write-number">--auto-generate-sql-unique-write-number</a></td>
<td>How many different queries to generate for --auto-generate-sql-write-number</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-write-number">--auto-generate-sql-write-number</a></td>
<td>How many row inserts to perform on each thread</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_commit">--commit</a></td>
<td>How many statements to execute before committing</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td></td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_concurrency">--concurrency</a></td>
<td>Number of clients to simulate when issuing the SELECT statement</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_create">--create</a></td>
<td>File or string containing the statement to use for creating the table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_create-schema">--create-schema</a></td>
<td>Schema in which to run the tests</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_csv">--csv</a></td>
<td>Generate output in comma-separated values format</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_delimiter">--delimiter</a></td>
<td>Delimiter to use in SQL statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_detach">--detach</a></td>
<td>Detach (close and reopen) each connection after each N statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_enable-cleartext-plugin">--enable-cleartext-plugin</a></td>
<td>Enable cleartext authentication plugin</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_engine">--engine</a></td>
<td>Storage engine to use for creating the table</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_iterations">--iterations</a></td>
<td>Number of times to run the tests</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_no-drop">--no-drop</a></td>
<td>Do not drop any schema created during the test run</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_number-char-cols">--number-char-cols</a></td>
<td>Number of VARCHAR columns to use if --auto-generate-sql is specified</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_number-int-cols">--number-int-cols</a></td>
<td>Number of INT columns to use if --auto-generate-sql is specified</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_number-of-queries">--number-of-queries</a></td>
<td>Limit each client to approximately this number of queries</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_only-print">--only-print</a></td>
<td>Do not connect to databases. mysqlslap only prints what it would have done</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_pipe">--pipe</a></td>
<td>Connect to server using named pipe (Windows only)</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_post-query">--post-query</a></td>
<td>File or string containing the statement to execute after the tests have completed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_post-system">--post-system</a></td>
<td>String to execute using system() after the tests have completed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_pre-query">--pre-query</a></td>
<td>File or string containing the statement to execute before running the tests</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_pre-system">--pre-system</a></td>
<td>String to execute using system() before running the tests</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_query">--query</a></td>
<td>File or string containing the SELECT statement to use for retrieving data</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_silent">--silent</a></td>
<td>Silent mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_sql-mode">--sql-mode</a></td>
<td>Set SQL mode for client session</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_verbose">--verbose</a></td>
<td>Verbose mode</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlslap_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqlslap_help"></a>
            <a class="indexterm" name="idm46444422374704"></a>

            <a class="indexterm" name="idm46444422373248"></a>

            <a class="link" href="programs.html#option_mysqlslap_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql"></a>
            <a class="indexterm" name="idm46444422368736"></a>

            <a class="indexterm" name="idm46444422367280"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql"><code class="option">--auto-generate-sql</code></a>,
            <code class="option">-a</code>
          </p><p>
            Generate SQL statements automatically when they are not
            supplied in files or using command options.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-add-autoincrement"></a>
            <a class="indexterm" name="idm46444422362560"></a>

            <a class="indexterm" name="idm46444422361104"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-add-autoincrement"><code class="option">--auto-generate-sql-add-autoincrement</code></a>
          </p><p>
            Add an <code class="literal">AUTO_INCREMENT</code> column to
            automatically generated tables.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-execute-number"></a>
            <a class="indexterm" name="idm46444422356112"></a>

            <a class="indexterm" name="idm46444422354608"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-execute-number"><code class="option">--auto-generate-sql-execute-number=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Specify how many queries to generate automatically.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-guid-primary"></a>
            <a class="indexterm" name="idm46444422350096"></a>

            <a class="indexterm" name="idm46444422348592"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-guid-primary"><code class="option">--auto-generate-sql-guid-primary</code></a>
          </p><p>
            Add a GUID-based primary key to automatically generated
            tables.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-load-type"></a>
            <a class="indexterm" name="idm46444422344320"></a>

            <a class="indexterm" name="idm46444422342816"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-load-type"><code class="option">--auto-generate-sql-load-type=<em class="replaceable"><code>type</code></em></code></a>
          </p><p>
            Specify the test load type. The permissible values are
            <code class="literal">read</code> (scan tables),
            <code class="literal">write</code> (insert into tables),
            <code class="literal">key</code> (read primary keys),
            <code class="literal">update</code> (update primary keys), or
            <code class="literal">mixed</code> (half inserts, half scanning
            selects). The default is <code class="literal">mixed</code>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-secondary-indexes"></a>
            <a class="indexterm" name="idm46444422333872"></a>

            <a class="indexterm" name="idm46444422332416"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-secondary-indexes"><code class="option">--auto-generate-sql-secondary-indexes=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Specify how many secondary indexes to add to automatically
            generated tables. By default, none are added.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-unique-query-number"></a>
            <a class="indexterm" name="idm46444422327824"></a>

            <a class="indexterm" name="idm46444422326368"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-unique-query-number"><code class="option">--auto-generate-sql-unique-query-number=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            How many different queries to generate for automatic tests.
            For example, if you run a <code class="literal">key</code> test that
            performs 1000 selects, you can use this option with a value
            of 1000 to run 1000 unique queries, or with a value of 50 to
            perform 50 different selects. The default is 10.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-unique-write-number"></a>
            <a class="indexterm" name="idm46444422320832"></a>

            <a class="indexterm" name="idm46444422319376"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-unique-write-number"><code class="option">--auto-generate-sql-unique-write-number=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            How many different queries to generate for
            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-write-number"><code class="option">--auto-generate-sql-write-number</code></a>.
            The default is 10.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_auto-generate-sql-write-number"></a>
            <a class="indexterm" name="idm46444422313776"></a>

            <a class="indexterm" name="idm46444422312272"></a>

            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql-write-number"><code class="option">--auto-generate-sql-write-number=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            How many row inserts to perform. The default is 100.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_commit"></a>
            <a class="indexterm" name="idm46444422307920"></a>

            <a class="indexterm" name="idm46444422306464"></a>

            <a class="link" href="programs.html#option_mysqlslap_commit"><code class="option">--commit=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            How many statements to execute before committing. The
            default is 0 (no commits are done).
          </p></li><li class="listitem"><p><a name="option_mysqlslap_compress"></a>
            <a class="indexterm" name="idm46444422301984"></a>

            <a class="indexterm" name="idm46444422300496"></a>

            <a class="link" href="programs.html#option_mysqlslap_compress"><code class="option">--compress</code></a>,
            <code class="option">-C</code>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            As of MySQL 8.0.18, this option is deprecated. It will be
            removed in a future MySQL version. See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqlslap_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444422292640"></a><a class="indexterm" name="idm46444422291136"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_concurrency"></a>
            <a class="indexterm" name="idm46444422284256"></a>

            <a class="indexterm" name="idm46444422282768"></a>

            <a class="link" href="programs.html#option_mysqlslap_concurrency"><code class="option">--concurrency=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-c <em class="replaceable"><code>N</code></em></code>
          </p><p>
            The number of parallel clients to simulate.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_create"></a>
            <a class="indexterm" name="idm46444422277760"></a>

            <a class="indexterm" name="idm46444422276304"></a>

            <a class="link" href="programs.html#option_mysqlslap_create"><code class="option">--create=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            The file or string containing the statement to use for
            creating the table.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_create-schema"></a>
            <a class="indexterm" name="idm46444422271920"></a>

            <a class="indexterm" name="idm46444422270432"></a>

            <a class="link" href="programs.html#option_mysqlslap_create-schema"><code class="option">--create-schema=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            The schema in which to run the tests.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
              If the
              <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql"><code class="option">--auto-generate-sql</code></a>
              option is also given, <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> drops
              the schema at the end of the test run. To avoid this, use
              the <a class="link" href="programs.html#option_mysqlslap_no-drop"><code class="option">--no-drop</code></a> option as
              well.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlslap_csv"></a>
            <a class="indexterm" name="idm46444422261840"></a>

            <a class="indexterm" name="idm46444422260384"></a>

            <a class="link" href="programs.html#option_mysqlslap_csv"><code class="option">--csv[=<em class="replaceable"><code>file_name</code></em>]</code></a>
          </p><p>
            Generate output in comma-separated values format. The output
            goes to the named file, or to the standard output if no file
            is given.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_debug"></a>
            <a class="indexterm" name="idm46444422255792"></a>

            <a class="indexterm" name="idm46444422254336"></a>

            <a class="link" href="programs.html#option_mysqlslap_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:o,/tmp/mysqlslap.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_debug-check"></a>
            <a class="indexterm" name="idm46444422244736"></a>

            <a class="indexterm" name="idm46444422243248"></a>

            <a class="link" href="programs.html#option_mysqlslap_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_debug-info"></a>
            <a class="indexterm" name="idm46444422237152"></a>

            <a class="indexterm" name="idm46444422235664"></a>

            <a class="link" href="programs.html#option_mysqlslap_debug-info"><code class="option">--debug-info</code></a>,
            <code class="option">-T</code>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_default-auth"></a>
            <a class="indexterm" name="idm46444422229104"></a>

            <a class="indexterm" name="idm46444422227616"></a>

            <a class="link" href="programs.html#option_mysqlslap_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444422222512"></a>

            <a class="indexterm" name="idm46444422221056"></a>

            <a class="link" href="programs.html#option_mysqlslap_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_defaults-file"></a>
            <a class="indexterm" name="idm46444422214656"></a>

            <a class="indexterm" name="idm46444422213168"></a>

            <a class="link" href="programs.html#option_mysqlslap_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444422204800"></a>

            <a class="indexterm" name="idm46444422203344"></a>

            <a class="link" href="programs.html#option_mysqlslap_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqlslap]</code> groups. If the
            <a class="link" href="programs.html#option_mysqlslap_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> also reads the
            <code class="literal">[client_other]</code> and
            <code class="literal">[mysqlslap_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_delimiter"></a>
            <a class="indexterm" name="idm46444422190848"></a>

            <a class="indexterm" name="idm46444422189360"></a>

            <a class="link" href="programs.html#option_mysqlslap_delimiter"><code class="option">--delimiter=<em class="replaceable"><code>str</code></em></code></a>,
            <code class="option">-F <em class="replaceable"><code>str</code></em></code>
          </p><p>
            The delimiter to use in SQL statements supplied in files or
            using command options.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_detach"></a>
            <a class="indexterm" name="idm46444422184304"></a>

            <a class="indexterm" name="idm46444422182848"></a>

            <a class="link" href="programs.html#option_mysqlslap_detach"><code class="option">--detach=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Detach (close and reopen) each connection after each
            <em class="replaceable"><code>N</code></em> statements. The default is 0
            (connections are not detached).
          </p></li><li class="listitem"><p><a name="option_mysqlslap_enable-cleartext-plugin"></a>
            <a class="indexterm" name="idm46444422178000"></a>

            <a class="indexterm" name="idm46444422176496"></a>

            <a class="link" href="programs.html#option_mysqlslap_enable-cleartext-plugin"><code class="option">--enable-cleartext-plugin</code></a>
          </p><p>
            Enable the <code class="literal">mysql_clear_password</code> cleartext
            authentication plugin. (See
            <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.)
          </p></li><li class="listitem"><p><a name="option_mysqlslap_engine"></a>
            <a class="indexterm" name="idm46444422170864"></a>

            <a class="indexterm" name="idm46444422169408"></a>

            <a class="link" href="programs.html#option_mysqlslap_engine"><code class="option">--engine=<em class="replaceable"><code>engine_name</code></em></code></a>,
            <code class="option">-e <em class="replaceable"><code>engine_name</code></em></code>
          </p><p>
            The storage engine to use for creating tables.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_get-server-public-key"></a>
            <a class="indexterm" name="idm46444422164368"></a>

            <a class="indexterm" name="idm46444422162912"></a>

            <a class="link" href="programs.html#option_mysqlslap_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the RSA public key that it uses for
            key pair-based password exchange. This option applies to
            clients that connect to the server using an account that
            authenticates with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For connections by such accounts, the server does
            not send the public key to the client unless requested. The
            option is ignored for accounts that do not authenticate with
            that plugin. It is also ignored if RSA-based password
            exchange is not needed, as is the case when the client
            connects to the server using a secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlslap_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlslap_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_host"></a>
            <a class="indexterm" name="idm46444422152672"></a>

            <a class="indexterm" name="idm46444422151216"></a>

            <a class="link" href="programs.html#option_mysqlslap_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Connect to the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_iterations"></a>
            <a class="indexterm" name="idm46444422146176"></a>

            <a class="indexterm" name="idm46444422144688"></a>

            <a class="link" href="programs.html#option_mysqlslap_iterations"><code class="option">--iterations=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-i <em class="replaceable"><code>N</code></em></code>
          </p><p>
            The number of times to run the tests.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_login-path"></a>
            <a class="indexterm" name="idm46444422139680"></a>

            <a class="indexterm" name="idm46444422138192"></a>

            <a class="link" href="programs.html#option_mysqlslap_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_no-drop"></a>
            <a class="indexterm" name="idm46444422129344"></a>

            <a class="indexterm" name="idm46444422127856"></a>

            <a class="link" href="programs.html#option_mysqlslap_no-drop"><code class="option">--no-drop</code></a>
          </p><p>
            Prevent <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> from dropping any
            schema it creates during the test run.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_no-defaults"></a>
            <a class="indexterm" name="idm46444422122464"></a>

            <a class="indexterm" name="idm46444422120976"></a>

            <a class="link" href="programs.html#option_mysqlslap_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqlslap_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqlslap_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_number-char-cols"></a>
            <a class="indexterm" name="idm46444422109648"></a>

            <a class="indexterm" name="idm46444422108160"></a>

            <a class="link" href="programs.html#option_mysqlslap_number-char-cols"><code class="option">--number-char-cols=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-x <em class="replaceable"><code>N</code></em></code>
          </p><p>
            The number of <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a> columns
            to use if
            <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql"><code class="option">--auto-generate-sql</code></a> is
            specified.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_number-int-cols"></a>
            <a class="indexterm" name="idm46444422100864"></a>

            <a class="indexterm" name="idm46444422099376"></a>

            <a class="link" href="programs.html#option_mysqlslap_number-int-cols"><code class="option">--number-int-cols=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-y <em class="replaceable"><code>N</code></em></code>
          </p><p>
            The number of <a class="link" href="data-types.html#integer-types" title="11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT"><code class="literal">INT</code></a> columns to
            use if <a class="link" href="programs.html#option_mysqlslap_auto-generate-sql"><code class="option">--auto-generate-sql</code></a>
            is specified.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_number-of-queries"></a>
            <a class="indexterm" name="idm46444422092064"></a>

            <a class="indexterm" name="idm46444422090608"></a>

            <a class="link" href="programs.html#option_mysqlslap_number-of-queries"><code class="option">--number-of-queries=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Limit each client to approximately this many queries. Query
            counting takes into account the statement delimiter. For
            example, if you invoke <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> as
            follows, the <code class="literal">;</code> delimiter is recognized so
            that each instance of the query string counts as two
            queries. As a result, 5 rows (not 10) are inserted.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlslap --delimiter=";" --number-of-queries=10</code></strong>
         <strong class="userinput"><code>--query="use test;insert into t values(null)"</code></strong>
</pre></li><li class="listitem"><p><a name="option_mysqlslap_only-print"></a>
            <a class="indexterm" name="idm46444422081552"></a>

            <a class="indexterm" name="idm46444422080064"></a>

            <a class="link" href="programs.html#option_mysqlslap_only-print"><code class="option">--only-print</code></a>
          </p><p>
            Do not connect to databases. <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a>
            only prints what it would have done.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_password"></a>
            <a class="indexterm" name="idm46444422074656"></a>

            <a class="indexterm" name="idm46444422073168"></a>

            <a class="link" href="programs.html#option_mysqlslap_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqlslap_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> should not prompt for one, use
            the
            <a class="link" href="programs.html#option_mysqlslap_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_pipe"></a>
            <a class="indexterm" name="idm46444422060512"></a>

            <a class="indexterm" name="idm46444422059056"></a>

            <a class="link" href="programs.html#option_mysqlslap_pipe"><code class="option">--pipe</code></a>,
            <code class="option">-W</code>
          </p><p>
            On Windows, connect to the server using a named pipe. This
            option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a> system variable
            enabled to support named-pipe connections. In addition, the
            user making the connection must be a member of the Windows
            group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_plugin-dir"></a>
            <a class="indexterm" name="idm46444422051728"></a>

            <a class="indexterm" name="idm46444422050240"></a>

            <a class="link" href="programs.html#option_mysqlslap_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqlslap_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqlslap" title="4.5.8 mysqlslap — Load Emulation Client"><span class="command"><strong>mysqlslap</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_port"></a>
            <a class="indexterm" name="idm46444422042816"></a>

            <a class="indexterm" name="idm46444422041360"></a>

            <a class="link" href="programs.html#option_mysqlslap_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            For TCP/IP connections, the port number to use.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_post-query"></a>
            <a class="indexterm" name="idm46444422036256"></a>

            <a class="indexterm" name="idm46444422034768"></a>

            <a class="link" href="programs.html#option_mysqlslap_post-query"><code class="option">--post-query=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            The file or string containing the statement to execute after
            the tests have completed. This execution is not counted for
            timing purposes.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_post-system"></a>
            <a class="indexterm" name="idm46444422030272"></a>

            <a class="indexterm" name="idm46444422028784"></a>

            <a class="link" href="programs.html#option_mysqlslap_post-system"><code class="option">--post-system=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            The string to execute using <code class="literal">system()</code>
            after the tests have completed. This execution is not
            counted for timing purposes.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_pre-query"></a>
            <a class="indexterm" name="idm46444422023584"></a>

            <a class="indexterm" name="idm46444422022096"></a>

            <a class="link" href="programs.html#option_mysqlslap_pre-query"><code class="option">--pre-query=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            The file or string containing the statement to execute
            before running the tests. This execution is not counted for
            timing purposes.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_pre-system"></a>
            <a class="indexterm" name="idm46444422017552"></a>

            <a class="indexterm" name="idm46444422016064"></a>

            <a class="link" href="programs.html#option_mysqlslap_pre-system"><code class="option">--pre-system=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            The string to execute using <code class="literal">system()</code>
            before running the tests. This execution is not counted for
            timing purposes.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_print-defaults"></a>
            <a class="indexterm" name="idm46444422010928"></a>

            <a class="indexterm" name="idm46444422009440"></a>

            <a class="link" href="programs.html#option_mysqlslap_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_protocol"></a>
            <a class="indexterm" name="idm46444422004080"></a>

            <a class="indexterm" name="idm46444422002592"></a>

            <a class="link" href="programs.html#option_mysqlslap_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_query"></a>
            <a class="indexterm" name="idm46444421997584"></a>

            <a class="indexterm" name="idm46444421996128"></a>

            <a class="link" href="programs.html#option_mysqlslap_query"><code class="option">--query=<em class="replaceable"><code>value</code></em></code></a>,
            <code class="option">-q <em class="replaceable"><code>value</code></em></code>
          </p><p>
            The file or string containing the
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> statement to use for
            retrieving data.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_server-public-key-path"></a>
            <a class="indexterm" name="idm46444421989760"></a>

            <a class="indexterm" name="idm46444421988304"></a>

            <a class="link" href="programs.html#option_mysqlslap_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlslap_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlslap_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444421974496"></a>

            <a class="indexterm" name="idm46444421973040"></a>

            <a class="link" href="programs.html#option_mysqlslap_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_silent"></a>
            <a class="indexterm" name="idm46444421966032"></a>

            <a class="indexterm" name="idm46444421964576"></a>

            <a class="link" href="programs.html#option_mysqlslap_silent"><code class="option">--silent</code></a>,
            <code class="option">-s</code>
          </p><p>
            Silent mode. No output.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_socket"></a>
            <a class="indexterm" name="idm46444421960128"></a>

            <a class="indexterm" name="idm46444421958672"></a>

            <a class="link" href="programs.html#option_mysqlslap_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_sql-mode"></a>
            <a class="indexterm" name="idm46444421949568"></a>

            <a class="indexterm" name="idm46444421948080"></a>

            <a class="link" href="programs.html#option_mysqlslap_sql-mode"><code class="option">--sql-mode=<em class="replaceable"><code>mode</code></em></code></a>
          </p><p>
            Set the SQL mode for the client session.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_ssl"></a>
            <a class="indexterm" name="idm46444421943648"></a>

            <a class="indexterm" name="idm46444421942192"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqlslap_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444421936352"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqlslap_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqlslap_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqlslap_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqlslap_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlslap_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444421919232"></a>

            <a class="indexterm" name="idm46444421917744"></a>

            <a class="link" href="programs.html#option_mysqlslap_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_tls-version"></a>
            <a class="indexterm" name="idm46444421911936"></a>

            <a class="indexterm" name="idm46444421910448"></a>

            <a class="link" href="programs.html#option_mysqlslap_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_user"></a>
            <a class="indexterm" name="idm46444421905072"></a>

            <a class="indexterm" name="idm46444421903616"></a>

            <a class="link" href="programs.html#option_mysqlslap_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use for connecting to
            the server.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_verbose"></a>
            <a class="indexterm" name="idm46444421898528"></a>

            <a class="indexterm" name="idm46444421897040"></a>

            <a class="link" href="programs.html#option_mysqlslap_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does. This option can be used multiple times to increase the
            amount of information.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_version"></a>
            <a class="indexterm" name="idm46444421892416"></a>

            <a class="indexterm" name="idm46444421890928"></a>

            <a class="link" href="programs.html#option_mysqlslap_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlslap_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqlslap_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444421885024"></a><a class="indexterm" name="idm46444421883520"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-admin-utils"></a>4.6 Administrative and Utility Programs</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#ibd2sdi">4.6.1 <span class="command"><strong>ibd2sdi</strong></span> — InnoDB Tablespace SDI Extraction Utility</a></span></dt><dt><span class="section"><a href="programs.html#innochecksum">4.6.2 <span class="command"><strong>innochecksum</strong></span> — Offline InnoDB File Checksum Utility</a></span></dt><dt><span class="section"><a href="programs.html#myisam-ftdump">4.6.3 <span class="command"><strong>myisam_ftdump</strong></span> — Display Full-Text Index information</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk">4.6.4 <span class="command"><strong>myisamchk</strong></span> — MyISAM Table-Maintenance Utility</a></span></dt><dt><span class="section"><a href="programs.html#myisamlog">4.6.5 <span class="command"><strong>myisamlog</strong></span> — Display MyISAM Log File Contents</a></span></dt><dt><span class="section"><a href="programs.html#myisampack">4.6.6 <span class="command"><strong>myisampack</strong></span> — Generate Compressed, Read-Only MyISAM Tables</a></span></dt><dt><span class="section"><a href="programs.html#mysql-config-editor">4.6.7 <span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility</a></span></dt><dt><span class="section"><a href="programs.html#mysqlbinlog">4.6.8 <span class="command"><strong>mysqlbinlog</strong></span> — Utility for Processing Binary Log Files</a></span></dt><dt><span class="section"><a href="programs.html#mysqldumpslow">4.6.9 <span class="command"><strong>mysqldumpslow</strong></span> — Summarize Slow Query Log Files</a></span></dt></dl>
</div>
<p>
    This section describes administrative programs and programs that
    perform miscellaneous utility operations.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="ibd2sdi"></a>4.6.1 <span class="command"><strong>ibd2sdi</strong></span> — InnoDB Tablespace SDI Extraction Utility</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46444421873664"></a><a class="indexterm" name="idm46444421872720"></a><p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> is a utility for extracting
        <a class="link" href="glossary.html#glos_serialized_dictionary_information" title="serialized dictionary information (SDI)">serialized
        dictionary information</a> (SDI) from
        <code class="literal">InnoDB</code> tablespace files. SDI data is present
        all persistent <code class="literal">InnoDB</code> tablespace files.
      </p><p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> can be run on
        <a class="link" href="glossary.html#glos_file_per_table" title="file-per-table">file-per-table</a>
        tablespace files (<code class="filename">*.ibd</code> files),
        <a class="link" href="glossary.html#glos_general_tablespace" title="general tablespace">general
        tablespace</a> files (<code class="filename">*.ibd</code> files),
        <a class="link" href="glossary.html#glos_system_tablespace" title="system tablespace">system tablespace</a>
        files (<code class="filename">ibdata*</code> files), and the data
        dictionary tablespace (<code class="filename">mysql.ibd</code>). It is
        not supported for use with temporary tablespaces or undo
        tablespaces.
      </p><p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> can be used at runtime or while the
        server is offline. During <a class="link" href="glossary.html#glos_ddl" title="DDL">DDL</a>
        operations,
        <a class="link" href="sql-statements.html#commit" title="13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements"><code class="literal">ROLLBACK</code></a>
        operations, and undo log purge operations related to SDI, there
        may be a short interval of time when <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a>
        fails to read SDI data stored in the tablespace.
      </p><p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> performs an uncommitted read of SDI
        from the specified tablespace. Redo logs and undo logs are not
        accessed.
      </p><p>
        Invoke the <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> utility like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>file_name1</code></em> [<em class="replaceable"><code>file_name2 file_name3 ...</code></em>]</code></strong>
</pre><p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> supports multi-file tablespaces like
        the <code class="literal">InnoDB</code> system tablespace, but it cannot
        be run on more than one tablespace at a time. For multi-file
        tablespaces, specify each file:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi ibdata1 ibdata2</code></strong>
</pre><p>
        The files of a multi-file tablespace must be specified in order
        of the ascending page number. If two successive files have the
        same space ID, the later file must start with the last page
        number of the previous file + 1.
      </p><p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> outputs SDI (containing id, type, and
        data fields) in <a class="link" href="data-types.html#json" title="11.5 The JSON Data Type"><code class="literal">JSON</code></a> format.
</p>
<h4><a name="idm46444421840896"></a>ibd2sdi Options</h4>
<p>
        <a class="link" href="programs.html#ibd2sdi" title="4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility"><span class="command"><strong>ibd2sdi</strong></span></a> supports the following options:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_ibd2sdi_help"></a>
            <a class="indexterm" name="idm46444421837360"></a>

            <a class="indexterm" name="idm46444421835904"></a>

            <a class="link" href="programs.html#option_ibd2sdi_help"><code class="option">--help</code></a>, <code class="option">-h</code>
          </p><p>
            Displays command-line help.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --help</code></strong>
Usage: ./ibd2sdi [-v] [-c &lt;strict-check&gt;] [-d &lt;dump file name&gt;] [-n] filename1 [filenames]
See http://dev.mysql.com/doc/refman/8.0/en/ibd2sdi.html for usage hints.
  -h, --help          Display this help and exit.
  -v, --version       Display version information and exit.
  -#, --debug[=name]  Output debug log. See
                      http://dev.mysql.com/doc/refman/8.0/en/dbug-package.html
  -d, --dump-file=name 
                      Dump the tablespace SDI into the file passed by user.
                      Without the filename, it will default to stdout
  -s, --skip-data     Skip retrieving data from SDI records. Retrieve only id
                      and type.
  -i, --id=#          Retrieve the SDI record matching the id passed by user.
  -t, --type=#        Retrieve the SDI records matching the type passed by
                      user.
  -c, --strict-check=name 
                      Specify the strict checksum algorithm by the user.
                      Allowed values are innodb, crc32, none.
  -n, --no-check      Ignore the checksum verification.
  -p, --pretty        Pretty format the SDI output.If false, SDI would be not
                      human readable but it will be of less size
                      (Defaults to on; use --skip-pretty to disable.)

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- ----------------------------------------
debug                             (No default value)
dump-file                         (No default value)
skip-data                         FALSE
id                                0
type                              0
strict-check                      crc32
no-check                          FALSE
pretty                            TRUE
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_version"></a>
            <a class="indexterm" name="idm46444421826848"></a>

            <a class="indexterm" name="idm46444421825392"></a>

            <a class="link" href="programs.html#option_ibd2sdi_version"><code class="option">--version</code></a>,
            <code class="option">-v</code>
          </p><p>
            Displays MySQL version information.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --version</code></strong>
ibd2sdi  Ver 8.0.3-dmr for Linux on x86_64 (Source distribution)
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_debug"></a>
            <a class="indexterm" name="idm46444421819024"></a>

            <a class="indexterm" name="idm46444421817568"></a>

            <a class="link" href="programs.html#option_ibd2sdi_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Prints a debug log. For debug options, refer to
            <a class="xref" href="extending-mysql.html#dbug-package" title="29.5.4 The DBUG Package">Section 29.5.4, “The DBUG Package”</a>.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --debug=d:t /tmp/ibd2sdi.trace</code></strong>
</pre><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_ibd2sdi_dump-file"></a>
            <a class="indexterm" name="idm46444421807728"></a>

            <a class="indexterm" name="idm46444421806240"></a>

            <a class="link" href="programs.html#option_ibd2sdi_dump-file"><code class="option">--dump-file=</code></a>,
            <code class="option">-d</code>
          </p><p>
            Dumps serialized dictionary information (SDI) into the
            specified dump file. If a dump file is not specified, the
            tablespace SDI is dumped to <code class="literal">stdout</code>.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --dump-file=<em class="replaceable"><code>file_name</code></em> ../data/test/t1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_skip-data"></a>
            <a class="indexterm" name="idm46444421798752"></a>

            <a class="indexterm" name="idm46444421797264"></a>

            <a class="link" href="programs.html#option_ibd2sdi_skip-data"><code class="option">--skip-data</code></a>,
            <code class="option">-s</code>
          </p><p>
            Skips retrieval of <code class="literal">data</code> field values from
            the serialized dictionary information (SDI) and only
            retrieves the <code class="literal">id</code> and
            <code class="literal">type</code> field values, which are primary keys
            for SDI records.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --skip-data ../data/test/t1.ibd</code></strong>
["ibd2sdi"
,
{
	"type": 1,
	"id": 330
}
,
{
	"type": 2,
	"id": 7
}
]
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_id"></a>
            <a class="indexterm" name="idm46444421788576"></a>

            <a class="indexterm" name="idm46444421787120"></a>

            <a class="link" href="programs.html#option_ibd2sdi_id"><code class="option">--id=<em class="replaceable"><code>#</code></em></code></a>,
            <code class="option">-i <em class="replaceable"><code>#</code></em></code>
          </p><p>
            Retrieves serialized dictionary information (SDI) matching
            the specified table or tablespace object id. An object id is
            unique to the object type. Table and tablespace object IDs
            are also found in the <code class="literal">id</code> column of the
            <code class="literal">mysql.tables</code> and
            <code class="literal">mysql.tablespace</code> data dictionary tables.
            For information about data dictionary tables, see
            <a class="xref" href="data-dictionary.html#data-dictionary-schema" title="14.1 Data Dictionary Schema">Section 14.1, “Data Dictionary Schema”</a>.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --id=7 ../data/test/t1.ibd</code></strong>
["ibd2sdi"
,
{
	"type": 2,
	"id": 7,
	"object":
		{
    "mysqld_version_id": 80003,
    "dd_version": 80003,
    "sdi_version": 1,
    "dd_object_type": "Tablespace",
    "dd_object": {
        "name": "test/t1",
        "comment": "",
        "options": "",
        "se_private_data": "flags=16417;id=2;server_version=80003;space_version=1;",
        "engine": "InnoDB",
        "files": [
            {
                "ordinal_position": 1,
                "filename": "./test/t1.ibd",
                "se_private_data": "id=2;"
            }
        ]
    }
}
}
]
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_type"></a>
            <a class="indexterm" name="idm46444421776448"></a>

            <a class="indexterm" name="idm46444421774992"></a>

            <a class="link" href="programs.html#option_ibd2sdi_type"><code class="option">--type=<em class="replaceable"><code>#</code></em></code></a>,
            <code class="option">-t <em class="replaceable"><code>#</code></em></code>
          </p><p>
            Retrieves serialized dictionary information (SDI) matching
            the specified object type. SDI is provided for table
            (type=1) and tablespace (type=2) objects.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --type=2 ../data/test/t1.ibd</code></strong>
["ibd2sdi"
,
{
	"type": 2,
	"id": 7,
	"object":
		{
    "mysqld_version_id": 80003,
    "dd_version": 80003,
    "sdi_version": 1,
    "dd_object_type": "Tablespace",
    "dd_object": {
        "name": "test/t1",
        "comment": "",
        "options": "",
        "se_private_data": "flags=16417;id=2;server_version=80003;space_version=1;",
        "engine": "InnoDB",
        "files": [
            {
                "ordinal_position": 1,
                "filename": "./test/t1.ibd",
                "se_private_data": "id=2;"
            }
        ]
    }
}
}
]
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_strict-check"></a>
            <a class="indexterm" name="idm46444421766768"></a>

            <a class="indexterm" name="idm46444421765280"></a>

            <a class="link" href="programs.html#option_ibd2sdi_strict-check"><code class="option">--strict-check</code></a>,
            <code class="option">-c</code>
          </p><p>
            Specifies a strict checksum algorithm for validating the
            checksum of pages that are read. Options include
            <code class="literal">innodb</code>, <code class="literal">crc32</code>, and
            <code class="literal">none</code>.
          </p><p>
            In this example, the strict version of the
            <code class="literal">innodb</code> checksum algorithm is specified:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --strict-check=innodb ../data/test/t1.ibd</code></strong>
</pre><p>
            In this example, the strict version of
            <code class="literal">crc32</code> checksum algorithm is specified:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi -c crc32 ../data/test/t1.ibd</code></strong>
</pre><p>
            If you do not specify the
            <a class="link" href="programs.html#option_ibd2sdi_strict-check"><code class="option">--strict-check</code></a> option,
            validation is performed against non-strict
            <code class="literal">innodb</code>, <code class="literal">crc32</code> and
            <code class="literal">none</code> checksums.
          </p></li><li class="listitem"><p><a name="option_ibd2sdi_no-check"></a>
            <a class="indexterm" name="idm46444421749104"></a>

            <a class="indexterm" name="idm46444421747648"></a>

            <a class="link" href="programs.html#option_ibd2sdi_no-check"><code class="option">--no-check</code></a>,
            <code class="option">-n</code>
          </p><p>
            Skips checksum validation for pages that are read.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --no-check ../data/test/t1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_ibd2sdi_pretty"></a>
            <a class="indexterm" name="idm46444421741264"></a>

            <a class="indexterm" name="idm46444421739808"></a>

            <a class="link" href="programs.html#option_ibd2sdi_pretty"><code class="option">--pretty</code></a>,
            <code class="option">-p</code>
          </p><p>
            Outputs SDI data in JSON pretty print format. Enabled by
            default. If disabled, SDI is not human readable but is
            smaller in size. Use <code class="literal">--skip-pretty</code> to
            disable.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ibd2sdi --skip-pretty ../data/test/t1.ibd</code></strong>
</pre></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="innochecksum"></a>4.6.2 <span class="command"><strong>innochecksum</strong></span> — Offline InnoDB File Checksum Utility</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444421731744"></a><p>
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> prints checksums for
        <code class="literal">InnoDB</code> files. This tool reads an
        <code class="literal">InnoDB</code> tablespace file, calculates the
        checksum for each page, compares the calculated checksum to the
        stored checksum, and reports mismatches, which indicate damaged
        pages. It was originally developed to speed up verifying the
        integrity of tablespace files after power outages but can also
        be used after file copies. Because checksum mismatches cause
        <code class="literal">InnoDB</code> to deliberately shut down a running
        server, it may be preferable to use this tool rather than
        waiting for an in-production server to encounter the damaged
        pages.
      </p><p>
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> cannot be used on tablespace
        files that the server already has open. For such files, you
        should use <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a> to check
        tables within the tablespace. Attempting to run
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> on a tablespace that the server
        already has open will result in an <span class="quote">“<span class="quote"><span class="errortext">Unable to
        lock file</span></span>”</span> error.
      </p><p>
        If checksum mismatches are found, you would normally restore the
        tablespace from backup or start the server and attempt to use
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to make a backup of the tables
        within the tablespace.
      </p><p>
        Invoke <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>file_name</code></em></code></strong>
</pre>
<h4><a name="idm46444421715568"></a>innochecksum Options</h4>
<p>
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> supports the following options.
        For options that refer to page numbers, the numbers are
        zero-based.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_innochecksum_help"></a>
            <a class="indexterm" name="idm46444421711824"></a>

            <a class="indexterm" name="idm46444421710336"></a>

            <a class="link" href="programs.html#option_innochecksum_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Displays command line help. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --help</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_info"></a>
            <a class="indexterm" name="idm46444421704016"></a>

            <a class="indexterm" name="idm46444421702528"></a>

            <a class="link" href="programs.html#option_innochecksum_info"><code class="option">--info</code></a>,
            <code class="option">-I</code>
          </p><p>
            Synonym for <a class="link" href="programs.html#option_innochecksum_help"><code class="option">--help</code></a>.
            Displays command line help. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --info</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_version"></a>
            <a class="indexterm" name="idm46444421695152"></a>

            <a class="indexterm" name="idm46444421693664"></a>

            <a class="link" href="programs.html#option_innochecksum_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Displays version information. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --version</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_verbose"></a>
            <a class="indexterm" name="idm46444421687392"></a>

            <a class="indexterm" name="idm46444421685904"></a>

            <a class="link" href="programs.html#option_innochecksum_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode; prints a progress indicator to the log file
            every five seconds. In order for the progress indicator to
            be printed, the log file must be specified using the
            <code class="literal">--log option</code>. To turn on
            <code class="literal">verbose</code> mode, run:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --verbose</code></strong>
</pre><p>
            To turn off verbose mode, run:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --verbose=FALSE</code></strong>
</pre><p>
            The <code class="literal">--verbose</code> option and
            <code class="literal">--log</code> option can be specified at the same
            time. For example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --verbose --log=/var/lib/mysql/test/logtest.txt</code></strong>
</pre><p>
            To locate the progress indicator information in the log
            file, you can perform the following search:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>cat ./logtest.txt | grep -i "okay"</code></strong>
</pre><p>
            The progress indicator information in the log file appears
            similar to the following:
          </p><pre data-lang="none" class="programlisting">page 1663 okay: 2.863% done
page 8447 okay: 14.537% done
page 13695 okay: 23.568% done
page 18815 okay: 32.379% done
page 23039 okay: 39.648% done
page 28351 okay: 48.789% done
page 33023 okay: 56.828% done
page 37951 okay: 65.308% done
page 44095 okay: 75.881% done
page 49407 okay: 85.022% done
page 54463 okay: 93.722% done
...</pre></li><li class="listitem"><p><a name="option_innochecksum_count"></a>
            <a class="indexterm" name="idm46444421668288"></a>

            <a class="indexterm" name="idm46444421666800"></a>

            <a class="link" href="programs.html#option_innochecksum_count"><code class="option">--count</code></a>,
            <code class="option">-c</code>
          </p><p>
            Print a count of the number of pages in the file and exit.
            Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --count ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_start-page"></a>
            <a class="indexterm" name="idm46444421660336"></a>

            <a class="indexterm" name="idm46444421658848"></a>

            <a class="link" href="programs.html#option_innochecksum_start-page"><code class="option">--start-page=<em class="replaceable"><code>num</code></em></code></a>,
            <code class="option">-s <em class="replaceable"><code>num</code></em></code>
          </p><p>
            Start at this page number. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --start-page=600 ../data/test/tab1.ibd</code></strong>
</pre><p>
            or:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum -s 600 ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_end-page"></a>
            <a class="indexterm" name="idm46444421649872"></a>

            <a class="indexterm" name="idm46444421648384"></a>

            <a class="link" href="programs.html#option_innochecksum_end-page"><code class="option">--end-page=<em class="replaceable"><code>num</code></em></code></a>,
            <code class="option">-e <em class="replaceable"><code>num</code></em></code>
          </p><p>
            End at this page number. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --end-page=700 ../data/test/tab1.ibd</code></strong>
</pre><p>
            or:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --p 700 ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_page"></a>
            <a class="indexterm" name="idm46444421639344"></a>

            <a class="indexterm" name="idm46444421637856"></a>

            <a class="link" href="programs.html#option_innochecksum_page"><code class="option">--page=<em class="replaceable"><code>num</code></em></code></a>,
            <code class="option">-p <em class="replaceable"><code>num</code></em></code>
          </p><p>
            Check only this page number. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --page=701 ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_strict-check"></a>
            <a class="indexterm" name="idm46444421630992"></a>

            <a class="indexterm" name="idm46444421629504"></a>

            <a class="link" href="programs.html#option_innochecksum_strict-check"><code class="option">--strict-check</code></a>,
            <code class="option">-C</code>
          </p><p>
            Specify a strict checksum algorithm. Options include
            <code class="literal">innodb</code>, <code class="literal">crc32</code>, and
            <code class="literal">none</code>.
          </p><p>
            In this example, the <code class="literal">innodb</code> checksum
            algorithm is specified:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --strict-check=innodb ../data/test/tab1.ibd</code></strong>
</pre><p>
            In this example, the <code class="literal">crc32</code> checksum
            algorithm is specified:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum -C crc32 ../data/test/tab1.ibd</code></strong>
</pre><p>
            The following conditions apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                If you do not specify the
                <a class="link" href="programs.html#option_innochecksum_strict-check"><code class="option">--strict-check</code></a>
                option, <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> validates
                against <code class="literal">innodb</code>,
                <code class="literal">crc32</code> and <code class="literal">none</code>.
              </p></li><li class="listitem"><p>
                If you specify the <code class="literal">none</code> option, only
                checksums generated by <code class="literal">none</code> are
                allowed.
              </p></li><li class="listitem"><p>
                If you specify the <code class="literal">innodb</code> option,
                only checksums generated by <code class="literal">innodb</code>
                are allowed.
              </p></li><li class="listitem"><p>
                If you specify the <code class="literal">crc32</code> option, only
                checksums generated by <code class="literal">crc32</code> are
                allowed.
</p></li></ul>
</div>
</li><li class="listitem"><p><a name="option_innochecksum_no-check"></a>
            <a class="indexterm" name="idm46444421603920"></a>

            <a class="indexterm" name="idm46444421602432"></a>

            <a class="link" href="programs.html#option_innochecksum_no-check"><code class="option">--no-check</code></a>,
            <code class="option">-n</code>
          </p><p>
            Ignore the checksum verification when rewriting a checksum.
            This option may only be used with the
            <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a>
            <a class="link" href="programs.html#option_innochecksum_write"><code class="option">--write</code></a> option. If the
            <a class="link" href="programs.html#option_innochecksum_write"><code class="option">--write</code></a> option is not
            specified, <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> will terminate.
          </p><p>
            In this example, an <code class="literal">innodb</code> checksum is
            rewritten to replace an invalid checksum:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --no-check --write innodb ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_allow-mismatches"></a>
            <a class="indexterm" name="idm46444421590192"></a>

            <a class="indexterm" name="idm46444421588704"></a>

            <a class="link" href="programs.html#option_innochecksum_allow-mismatches"><code class="option">--allow-mismatches</code></a>,
            <code class="option">-a</code>
          </p><p>
            The maximum number of checksum mismatches allowed before
            <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> terminates. The default
            setting is 0. If
            <code class="literal">--allow-mismatches=</code><em class="replaceable"><code>N</code></em>,
            where <code class="literal"><em class="replaceable"><code>N</code></em>&gt;=0</code>,
            <em class="replaceable"><code>N</code></em> mismatches are permitted and
            <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> terminates at
            <code class="literal"><em class="replaceable"><code>N</code></em>+1</code>. When
            <code class="literal">--allow-mismatches</code> is set to 0,
            <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> terminates on the first
            checksum mismatch.
          </p><p>
            In this example, an existing <code class="literal">innodb</code>
            checksum is rewritten to set
            <code class="literal">--allow-mismatches</code> to 1.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --allow-mismatches=1 --write innodb ../data/test/tab1.ibd</code></strong>
</pre><p>
            With <code class="literal">--allow-mismatches</code> set to 1, if
            there is a mismatch at page 600 and another at page 700 on a
            file with 1000 pages, the checksum is updated for pages
            0-599 and 601-699. Because
            <code class="literal">--allow-mismatches</code> is set to 1, the
            checksum tolerates the first mismatch and terminates on the
            second mismatch, leaving page 600 and pages 700-999
            unchanged.
          </p></li><li class="listitem"><p><a name="option_innochecksum_write"></a>
            <a class="indexterm" name="idm46444421570288"></a>

            <a class="indexterm" name="idm46444421568800"></a>

            <a class="link" href="programs.html#option_innochecksum_write"><code class="option">--write=<em class="replaceable"><code>name</code></em></code></a>,
            <code class="option">-w <em class="replaceable"><code>num</code></em></code>
          </p><p>
            Rewrite a checksum. When rewriting an invalid checksum, the
            <a class="link" href="programs.html#option_innochecksum_no-check"><code class="option">--no-check</code></a> option must
            be used together with the <code class="option">--write</code> option.
            The <a class="link" href="programs.html#option_innochecksum_no-check"><code class="option">--no-check</code></a> option
            tells <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> to ignore verification
            of the invalid checksum. You do not have to specify the
            <a class="link" href="programs.html#option_innochecksum_no-check"><code class="option">--no-check</code></a> option if
            the current checksum is valid.
          </p><p>
            An algorithm must be specified when using the
            <a class="link" href="programs.html#option_innochecksum_write"><code class="option">--write</code></a> option.
            Possible values for the <code class="option">--write</code> option are:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">innodb</code>: A checksum calculated in
                software, using the original algorithm from
                <code class="literal">InnoDB</code>.
              </p></li><li class="listitem"><p>
                <code class="literal">crc32</code>: A checksum calculated using
                the <code class="literal">crc32</code> algorithm, possibly done
                with a hardware assist.
              </p></li><li class="listitem"><p>
                <code class="literal">none</code>: A constant number.
</p></li></ul>
</div>
<p>
            The <code class="option">--write</code> option rewrites entire pages to
            disk. If the new checksum is identical to the existing
            checksum, the new checksum is not written to disk in order
            to minimize I/O.
          </p><p>
            <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> obtains an exclusive lock
            when the <code class="option">--write</code> option is used.
          </p><p>
            In this example, a <code class="literal">crc32</code> checksum is
            written for <code class="filename">tab1.ibd</code>:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum -w crc32 ../data/test/tab1.ibd</code></strong>
</pre><p>
            In this example, a <code class="literal">crc32</code> checksum is
            rewritten to replace an invalid <code class="literal">crc32</code>
            checksum:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --no-check --write crc32 ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_page-type-summary"></a>
            <a class="indexterm" name="idm46444421539984"></a>

            <a class="indexterm" name="idm46444421538528"></a>

            <a class="link" href="programs.html#option_innochecksum_page-type-summary"><code class="option">--page-type-summary</code></a>,
            <code class="option">-S</code>
          </p><p>
            Display a count of each page type in a tablespace. Example
            usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --page-type-summary ../data/test/tab1.ibd</code></strong>
</pre><p>
            Sample output for <code class="literal">--page-type-summary</code>:
          </p><pre data-lang="none" class="programlisting">File::../data/test/tab1.ibd
================PAGE TYPE SUMMARY==============
#PAGE_COUNT PAGE_TYPE
===============================================
       2        Index page
       0        Undo log page
       1        Inode page
       0        Insert buffer free list page
       2        Freshly allocated page
       1        Insert buffer bitmap
       0        System page
       0        Transaction system page
       1        File Space Header
       0        Extent descriptor page
       0        BLOB page
       0        Compressed BLOB page
       0        Other type of page
===============================================
Additional information:
Undo page type: 0 insert, 0 update, 0 other
Undo page state: 0 active, 0 cached, 0 to_free, 0 to_purge, 0 prepared, 0 other</pre></li><li class="listitem"><p><a name="option_innochecksum_page-type-dump"></a>
            <a class="indexterm" name="idm46444421528352"></a>

            <a class="indexterm" name="idm46444421526864"></a>

            <a class="link" href="programs.html#option_innochecksum_page-type-dump"><code class="option">--page-type-dump</code></a>,
            <code class="option">-D</code>
          </p><p>
            Dump the page type information for each page in a tablespace
            to <code class="literal">stderr</code> or <code class="literal">stdout</code>.
            Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --page-type-dump=/tmp/a.txt ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_log"></a>
            <a class="indexterm" name="idm46444421518992"></a>

            <a class="indexterm" name="idm46444421517536"></a>

            <a class="link" href="programs.html#option_innochecksum_log"><code class="option">--log</code></a>,
            <code class="option">-l</code>
          </p><p>
            Log output for the <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> tool. A
            log file name must be provided. Log output contains checksum
            values for each tablespace page. For uncompressed tables,
            LSN values are also provided. The
            <a class="link" href="programs.html#option_innochecksum_log"><code class="option">--log</code></a> replaces the
            <code class="literal">--debug</code> option, which was available in
            earlier releases. Example usage:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum --log=/tmp/log.txt ../data/test/tab1.ibd</code></strong>
</pre><p>
            or:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>innochecksum -l /tmp/log.txt ../data/test/tab1.ibd</code></strong>
</pre></li><li class="listitem"><p><a name="option_innochecksum_read-from-standard-in"></a>
            <a class="indexterm" name="idm46444421505968"></a>

            <a class="indexterm" name="idm46444421504464"></a>

            <code class="literal">-</code> option.
          </p><p>
            Specify the <code class="literal">-</code> option to read from
            standard input. If the <code class="literal">-</code> option is
            missing when <span class="quote">“<span class="quote">read from standard in</span>”</span> is
            expected, <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> will output
            <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> usage information indicating
            that the <span class="quote">“<span class="quote">-</span>”</span> option was omitted. Example
            usages:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>cat t1.ibd | innochecksum -</code></strong>
</pre><p>
            In this example, <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> writes the
            <code class="literal">crc32</code> checksum algorithm to
            <code class="filename">a.ibd</code> without changing the original
            <code class="filename">t1.ibd</code> file.
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>cat t1.ibd | innochecksum --write=crc32 - &gt; a.ibd</code></strong>
</pre></li></ul>
</div>
<h4><a name="idm46444421489392"></a>Running innochecksum on Multiple User-defined Tablespace Files</h4>
<p>
        The following examples demonstrate how to run
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> on multiple user-defined
        tablespace files (<code class="filename">.ibd</code> files).
      </p><p>
        Run <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> for all tablespace
        (<code class="filename">.ibd</code>) files in the <span class="quote">“<span class="quote">test</span>”</span>
        database:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; innochecksum ./data/test/*.ibd</pre><p>
        Run <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> for all tablespace files
        (<code class="filename">.ibd</code> files) that have a file name starting
        with <span class="quote">“<span class="quote">t</span>”</span>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; innochecksum ./data/test/t*.ibd</pre><p>
        Run <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> for all tablespace files
        (<code class="filename">.ibd</code> files) in the
        <code class="filename">data</code> directory:
</p><pre data-lang="terminal" class="programlisting">shell&gt; innochecksum ./data/*/*.ibd</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Running <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> on multiple
          user-defined tablespace files is not supported on Windows
          operating systems, as Windows shells such as
          <span class="command"><strong>cmd.exe</strong></span> do not support glob pattern
          expansion. On Windows systems, <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a>
          must be run separately for each user-defined tablespace file.
          For example:
        </p><pre data-lang="terminal" class="programlisting">cmd&gt; innochecksum.exe t1.ibd
cmd&gt; innochecksum.exe t2.ibd
cmd&gt; innochecksum.exe t3.ibd</pre>
</div>
<h4><a name="idm46444421468880"></a>Running innochecksum on Multiple System Tablespace Files</h4>
<p>
        By default, there is only one <code class="literal">InnoDB</code> system
        tablespace file (<code class="filename">ibdata1</code>) but multiple
        files for the system tablespace can be defined using the
        <a class="link" href="innodb-storage-engine.html#sysvar_innodb_data_file_path"><code class="literal">innodb_data_file_path</code></a> option.
        In the following example, three files for the system tablespace
        are defined using the
        <a class="link" href="innodb-storage-engine.html#sysvar_innodb_data_file_path"><code class="literal">innodb_data_file_path</code></a> option:
        <code class="filename">ibdata1</code>, <code class="filename">ibdata2</code>, and
        <code class="filename">ibdata3</code>.
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>./bin/mysqld --no-defaults --innodb-data-file-path="ibdata1:10M;ibdata2:10M;ibdata3:10M:autoextend"</code></strong>
</pre><p>
        The three files (<code class="filename">ibdata1</code>,
        <code class="filename">ibdata2</code>, and <code class="filename">ibdata3</code>)
        form one logical system tablespace. To run
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> on multiple files that form one
        logical system tablespace, <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a>
        requires the <code class="literal">-</code> option to read tablespace
        files in from standard input, which is equivalent to
        concatenating multiple files to create one single file. For the
        example provided above, the following
        <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> command would be used:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; cat ibdata* | innochecksum -</pre><p>
        Refer to the <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> options information
        for more information about the <span class="quote">“<span class="quote">-</span>”</span> option.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          Running <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> on multiple files in
          the same tablespace is not supported on Windows operating
          systems, as Windows shells such as <span class="command"><strong>cmd.exe</strong></span>
          do not support glob pattern expansion. On Windows systems,
          <a class="link" href="programs.html#innochecksum" title="4.6.2 innochecksum — Offline InnoDB File Checksum Utility"><span class="command"><strong>innochecksum</strong></span></a> must be run separately for
          each system tablespace file. For example:
        </p><pre data-lang="terminal" class="programlisting">cmd&gt; innochecksum.exe ibdata1
cmd&gt; innochecksum.exe ibdata2
cmd&gt; innochecksum.exe ibdata3</pre>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="myisam-ftdump"></a>4.6.3 <span class="command"><strong>myisam_ftdump</strong></span> — Display Full-Text Index information</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444421442176"></a><p>
        

        <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> displays information about
        <code class="literal">FULLTEXT</code> indexes in <code class="literal">MyISAM</code>
        tables. It reads the <code class="literal">MyISAM</code> index file
        directly, so it must be run on the server host where the table
        is located. Before using <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a>, be
        sure to issue a <code class="literal">FLUSH TABLES</code> statement first
        if the server is running.
      </p><p>
        <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> scans and dumps the entire
        index, which is not particularly fast. On the other hand, the
        distribution of words changes infrequently, so it need not be
        run often.
      </p><p>
        Invoke <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisam_ftdump [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>tbl_name</code></em> <em class="replaceable"><code>index_num</code></em></code></strong>
</pre><p>
        The <em class="replaceable"><code>tbl_name</code></em> argument should be the
        name of a <code class="literal">MyISAM</code> table. You can also specify
        a table by naming its index file (the file with the
        <code class="filename">.MYI</code> suffix). If you do not invoke
        <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> in the directory where the
        table files are located, the table or index file name must be
        preceded by the path name to the table's database directory.
        Index numbers begin with 0.
      </p><p>
        Example: Suppose that the <code class="literal">test</code> database
        contains a table named <code class="literal">mytexttable</code> that has
        the following definition:
      </p><pre data-lang="sql" class="programlisting">CREATE TABLE mytexttable
(
  id   INT NOT NULL,
  txt  TEXT NOT NULL,
  PRIMARY KEY (id),
  FULLTEXT (txt)
) ENGINE=MyISAM;</pre><p>
        The index on <code class="literal">id</code> is index 0 and the
        <code class="literal">FULLTEXT</code> index on <code class="literal">txt</code> is
        index 1. If your working directory is the
        <code class="literal">test</code> database directory, invoke
        <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> as follows:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisam_ftdump mytexttable 1</code></strong>
</pre><p>
        If the path name to the <code class="literal">test</code> database
        directory is <code class="filename">/usr/local/mysql/data/test</code>,
        you can also specify the table name argument using that path
        name. This is useful if you do not invoke
        <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> in the database directory:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisam_ftdump /usr/local/mysql/data/test/mytexttable 1</code></strong>
</pre><p>
        You can use <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> to generate a list
        of index entries in order of frequency of occurrence like this
        on Unix-like systems:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisam_ftdump -c mytexttable 1 | sort -r</code></strong>
</pre><p>
        On Windows, use:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisam_ftdump -c mytexttable 1 | sort /R</code></strong>
</pre><p>
        <a class="link" href="programs.html#myisam-ftdump" title="4.6.3 myisam_ftdump — Display Full-Text Index information"><span class="command"><strong>myisam_ftdump</strong></span></a> supports the following options:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisam_ftdump_help"></a>
            <a class="indexterm" name="idm46444421401616"></a>

            <a class="indexterm" name="idm46444421400128"></a>

            <a class="link" href="programs.html#option_myisam_ftdump_help"><code class="option">--help</code></a>,
            <code class="option">-h</code> <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_myisam_ftdump_count"></a>
            <a class="indexterm" name="idm46444421395008"></a>

            <a class="indexterm" name="idm46444421393520"></a>

            <a class="link" href="programs.html#option_myisam_ftdump_count"><code class="option">--count</code></a>,
            <code class="option">-c</code>
          </p><p>
            Calculate per-word statistics (counts and global weights).
          </p></li><li class="listitem"><p><a name="option_myisam_ftdump_dump"></a>
            <a class="indexterm" name="idm46444421388880"></a>

            <a class="indexterm" name="idm46444421387392"></a>

            <a class="link" href="programs.html#option_myisam_ftdump_dump"><code class="option">--dump</code></a>,
            <code class="option">-d</code>
          </p><p>
            Dump the index, including data offsets and word weights.
          </p></li><li class="listitem"><p><a name="option_myisam_ftdump_length"></a>
            <a class="indexterm" name="idm46444421382768"></a>

            <a class="indexterm" name="idm46444421381280"></a>

            <a class="link" href="programs.html#option_myisam_ftdump_length"><code class="option">--length</code></a>,
            <code class="option">-l</code>
          </p><p>
            Report the length distribution.
          </p></li><li class="listitem"><p><a name="option_myisam_ftdump_stats"></a>
            <a class="indexterm" name="idm46444421376560"></a>

            <a class="indexterm" name="idm46444421375072"></a>

            <a class="link" href="programs.html#option_myisam_ftdump_stats"><code class="option">--stats</code></a>,
            <code class="option">-s</code>
          </p><p>
            Report global index statistics. This is the default
            operation if no other operation is specified.
          </p></li><li class="listitem"><p><a name="option_myisam_ftdump_verbose"></a>
            <a class="indexterm" name="idm46444421370336"></a>

            <a class="indexterm" name="idm46444421368848"></a>

            <a class="link" href="programs.html#option_myisam_ftdump_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more output about what the program does.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="myisamchk"></a>4.6.4 <span class="command"><strong>myisamchk</strong></span> — MyISAM Table-Maintenance Utility</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#myisamchk-general-options">4.6.4.1 myisamchk General Options</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk-check-options">4.6.4.2 myisamchk Check Options</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk-repair-options">4.6.4.3 myisamchk Repair Options</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk-other-options">4.6.4.4 Other myisamchk Options</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk-table-info">4.6.4.5 Obtaining Table Information with myisamchk</a></span></dt><dt><span class="section"><a href="programs.html#myisamchk-memory">4.6.4.6 myisamchk Memory Usage</a></span></dt></dl>
</div>
<a class="indexterm" name="idm46444421363264"></a><p>
        The <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> utility gets information about
        your database tables or checks, repairs, or optimizes them.
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> works with
        <code class="literal">MyISAM</code> tables (tables that have
        <code class="filename">.MYD</code> and <code class="filename">.MYI</code> files
        for storing data and indexes).
      </p><p>
        You can also use the <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a>
        and <a class="link" href="sql-statements.html#repair-table" title="13.7.3.5 REPAIR TABLE Statement"><code class="literal">REPAIR TABLE</code></a> statements to
        check and repair <code class="literal">MyISAM</code> tables. See
        <a class="xref" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement">Section 13.7.3.2, “CHECK TABLE Statement”</a>, and
        <a class="xref" href="sql-statements.html#repair-table" title="13.7.3.5 REPAIR TABLE Statement">Section 13.7.3.5, “REPAIR TABLE Statement”</a>.
      </p><p>
        The use of <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> with partitioned tables
        is not supported.
</p>
<div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Caution
</div>
<p>
          It is best to make a backup of a table before performing a
          table repair operation; under some circumstances the operation
          might cause data loss. Possible causes include but are not
          limited to file system errors.
</p>
</div>
<p>
        Invoke <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>tbl_name</code></em> ...</code></strong>
</pre><p>
        The <em class="replaceable"><code>options</code></em> specify what you want
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to do. They are described in the
        following sections. You can also get a list of options by
        invoking <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk --help</strong></span></a>.
      </p><p>
        With no options, <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> simply checks your
        table as the default operation. To get more information or to
        tell <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to take corrective action,
        specify options as described in the following discussion.
      </p><p>
        <em class="replaceable"><code>tbl_name</code></em> is the database table you
        want to check or repair. If you run <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>
        somewhere other than in the database directory, you must specify
        the path to the database directory, because
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> has no idea where the database is
        located. In fact, <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> does not actually
        care whether the files you are working on are located in a
        database directory. You can copy the files that correspond to a
        database table into some other location and perform recovery
        operations on them there.
      </p><p>
        You can name several tables on the <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>
        command line if you wish. You can also specify a table by naming
        its index file (the file with the <code class="filename">.MYI</code>
        suffix). This enables you to specify all tables in a directory
        by using the pattern <code class="filename">*.MYI</code>. For example, if
        you are in a database directory, you can check all the
        <code class="literal">MyISAM</code> tables in that directory like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk *.MYI</code></strong>
</pre><p>
        If you are not in the database directory, you can check all the
        tables there by specifying the path to the directory:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk <em class="replaceable"><code>/path/to/database_dir/</code></em>*.MYI</code></strong>
</pre><p>
        You can even check all tables in all databases by specifying a
        wildcard with the path to the MySQL data directory:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk <em class="replaceable"><code>/path/to/datadir/*/*</code></em>.MYI</code></strong>
</pre><p>
        The recommended way to quickly check all
        <code class="literal">MyISAM</code> tables is:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk --silent --fast <em class="replaceable"><code>/path/to/datadir/*/*</code></em>.MYI</code></strong>
</pre><p>
        If you want to check all <code class="literal">MyISAM</code> tables and
        repair any that are corrupted, you can use the following
        command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk --silent --force --fast --update-state \</code></strong>
          <strong class="userinput"><code>--key_buffer_size=64M --myisam_sort_buffer_size=64M \</code></strong>
          <strong class="userinput"><code>--read_buffer_size=1M --write_buffer_size=1M \</code></strong>
          <strong class="userinput"><code><em class="replaceable"><code>/path/to/datadir/*/*</code></em>.MYI</code></strong>
</pre><p>
        This command assumes that you have more than 64MB free. For more
        information about memory allocation with
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>, see
        <a class="xref" href="programs.html#myisamchk-memory" title="4.6.4.6 myisamchk Memory Usage">Section 4.6.4.6, “myisamchk Memory Usage”</a>.
      </p><p>
        For additional information about using
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>, see
        <a class="xref" href="backup-and-recovery.html#myisam-table-maintenance" title="7.6 MyISAM Table Maintenance and Crash Recovery">Section 7.6, “MyISAM Table Maintenance and Crash Recovery”</a>.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
          <span class="emphasis"><em>You must ensure that no other program is using the
          tables while you are running
          <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a></em></span>. The most effective
          means of doing so is to shut down the MySQL server while
          running <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>, or to lock all tables
          that <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> is being used on.
        </p><p>
          Otherwise, when you run <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>, it may
          display the following error message:
        </p><pre data-lang="none" class="programlisting">warning: clients are using or haven't closed the table properly</pre><p>
          This means that you are trying to check a table that has been
          updated by another program (such as the
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server) that hasn't yet closed the
          file or that has died without closing the file properly, which
          can sometimes lead to the corruption of one or more
          <code class="literal">MyISAM</code> tables.
        </p><p>
          If <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> is running, you must force it to
          flush any table modifications that are still buffered in
          memory by using <a class="link" href="sql-statements.html#flush-tables"><code class="literal">FLUSH TABLES</code></a>.
          You should then ensure that no one is using the tables while
          you are running <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>
        </p><p>
          However, the easiest way to avoid this problem is to use
          <a class="link" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement"><code class="literal">CHECK TABLE</code></a> instead of
          <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to check tables. See
          <a class="xref" href="sql-statements.html#check-table" title="13.7.3.2 CHECK TABLE Statement">Section 13.7.3.2, “CHECK TABLE Statement”</a>.
</p>
</div>
<p>
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[myisamchk]</code> group of an option file. For
        information about option files used by MySQL programs, see
        <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444421287360"></a><p class="title"><b>Table 4.19 myisamchk Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for myisamchk."><col width="35%"><col width="64%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_analyze">--analyze</a></td>
<td>Analyze the distribution of key values</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_backup">--backup</a></td>
<td>Make a backup of the .MYD file as file_name-time.BAK</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_block-search">--block-search</a></td>
<td>Find the record that a block at the given offset belongs to</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_check">--check</a></td>
<td>Check the table for errors</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_check-only-changed">--check-only-changed</a></td>
<td>Check only tables that have changed since the last check</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_correct-checksum">--correct-checksum</a></td>
<td>Correct the checksum information for the table</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_data-file-length">--data-file-length</a></td>
<td>Maximum length of the data file (when re-creating data file when it is full)</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_debug">--debug</a></td>
<td>Write debugging log</td>
</tr><tr><td scope="row">--decode_bits</td>
<td>Decode_bits</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_description">--description</a></td>
<td>Print some descriptive information about the table</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_extend-check">--extend-check</a></td>
<td>Do very thorough table check or repair that tries to recover every possible row from the data file</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_fast">--fast</a></td>
<td>Check only tables that haven't been closed properly</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_force">--force</a></td>
<td>Do a repair operation automatically if myisamchk finds any errors in the table</td>
</tr><tr><td scope="row">--force</td>
<td>Overwrite old temporary files. For use with the -r or -o option</td>
</tr><tr><td scope="row">--ft_max_word_len</td>
<td>Maximum word length for FULLTEXT indexes</td>
</tr><tr><td scope="row">--ft_min_word_len</td>
<td>Minimum word length for FULLTEXT indexes</td>
</tr><tr><td scope="row">--ft_stopword_file</td>
<td>Use stopwords from this file instead of built-in list</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_HELP">--HELP</a></td>
<td>Display help message and exit</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_help">--help</a></td>
<td>Display help message and exit</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_information">--information</a></td>
<td>Print informational statistics about the table that is checked</td>
</tr><tr><td scope="row">--key_buffer_size</td>
<td>Size of buffer used for index blocks for MyISAM tables</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_keys-used">--keys-used</a></td>
<td>A bit-value that indicates which indexes to update</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_max-record-length">--max-record-length</a></td>
<td>Skip rows larger than the given length if myisamchk cannot allocate memory to hold them</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_medium-check">--medium-check</a></td>
<td>Do a check that is faster than an --extend-check operation</td>
</tr><tr><td scope="row">--myisam_block_size</td>
<td>Block size to be used for MyISAM index pages</td>
</tr><tr><td scope="row">--myisam_sort_buffer_size</td>
<td>The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_parallel-recover">--parallel-recover</a></td>
<td>Uses the same technique as -r and -n, but creates all the keys in parallel, using different threads (beta)</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_quick">--quick</a></td>
<td>Achieve a faster repair by not modifying the data file</td>
</tr><tr><td scope="row">--read_buffer_size</td>
<td>Each thread that does a sequential scan allocates a buffer of this size for each table it scans</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_read-only">--read-only</a></td>
<td>Do not mark the table as checked</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_recover">--recover</a></td>
<td>Do a repair that can fix almost any problem except unique keys that aren't unique</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_safe-recover">--safe-recover</a></td>
<td>Do a repair using an old recovery method that reads through all rows in order and updates all index trees based on the rows found</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_set-auto-increment">--set-auto-increment</a></td>
<td>Force AUTO_INCREMENT numbering for new records to start at the given value</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_set-collation">--set-collation</a></td>
<td>Specify the collation to use for sorting table indexes</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_silent">--silent</a></td>
<td>Silent mode</td>
</tr><tr><td scope="row">--sort_buffer_size</td>
<td>The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_sort-index">--sort-index</a></td>
<td>Sort the index tree blocks in high-low order</td>
</tr><tr><td scope="row">--sort_key_blocks</td>
<td>sort_key_blocks</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_sort-records">--sort-records</a></td>
<td>Sort records according to a particular index</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_sort-recover">--sort-recover</a></td>
<td>Force myisamchk to use sorting to resolve the keys even if the temporary files would be very large</td>
</tr><tr><td scope="row">--stats_method</td>
<td>Specifies how MyISAM index statistics collection code should treat NULLs</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_tmpdir">--tmpdir</a></td>
<td>Directory to be used for storing temporary files</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_unpack">--unpack</a></td>
<td>Unpack a table that was packed with myisampack</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_update-state">--update-state</a></td>
<td>Store information in the .MYI file to indicate when the table was checked and whether the table crashed</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_verbose">--verbose</a></td>
<td>Verbose mode</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_myisamchk_version">--version</a></td>
<td>Display version information and exit</td>
</tr><tr><td scope="row">--write_buffer_size</td>
<td>Write buffer size</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="section">

<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="myisamchk-general-options"></a>4.6.4.1 myisamchk General Options</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444421131904"></a><a class="indexterm" name="idm46444421130416"></a><p>
        The options described in this section can be used for any type
        of table maintenance operation performed by
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>. The sections following this one
        describe options that pertain only to specific operations, such
        as table checking or repairing.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisamchk_help"></a>
            <a class="indexterm" name="idm46444421125792"></a>

            <a class="indexterm" name="idm46444421124336"></a>

            <a class="link" href="programs.html#option_myisamchk_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit. Options are grouped by type
            of operation.
          </p></li><li class="listitem"><p><a name="option_myisamchk_HELP"></a>
            <a class="indexterm" name="idm46444421119824"></a>

            <a class="indexterm" name="idm46444421118368"></a>

            <a class="link" href="programs.html#option_myisamchk_HELP"><code class="option">--HELP</code></a>,
            <code class="option">-H</code>
          </p><p>
            Display a help message and exit. Options are presented in a
            single list.
          </p></li><li class="listitem"><p><a name="option_myisamchk_debug"></a>
            <a class="indexterm" name="idm46444421113792"></a>

            <a class="indexterm" name="idm46444421112336"></a>

            <a class="link" href="programs.html#option_myisamchk_debug"><code class="option">--debug=<em class="replaceable"><code>debug_options</code></em></code></a>,
            <code class="option">-# <em class="replaceable"><code>debug_options</code></em></code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:o,/tmp/myisamchk.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_myisamchk_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444421103088"></a>

            <a class="indexterm" name="idm46444421101632"></a>

            <a class="link" href="programs.html#option_myisamchk_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_defaults-file"></a>
            <a class="indexterm" name="idm46444421095232"></a>

            <a class="indexterm" name="idm46444421093744"></a>

            <a class="link" href="programs.html#option_myisamchk_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444421087488"></a>

            <a class="indexterm" name="idm46444421086032"></a>

            <a class="link" href="programs.html#option_myisamchk_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> normally reads the
            <code class="literal">[myisamchk]</code> group. If the
            <a class="link" href="programs.html#option_myisamchk_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> also reads the
            <code class="literal">[myisamchk_other]</code> group.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_no-defaults"></a>
            <a class="indexterm" name="idm46444421074912"></a>

            <a class="indexterm" name="idm46444421073424"></a>

            <a class="link" href="programs.html#option_myisamchk_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_myisamchk_no-defaults"><code class="option">--no-defaults</code></a> can be used
            to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_myisamchk_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_print-defaults"></a>
            <a class="indexterm" name="idm46444421062096"></a>

            <a class="indexterm" name="idm46444421060608"></a>

            <a class="link" href="programs.html#option_myisamchk_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_silent"></a>
            <a class="indexterm" name="idm46444421055296"></a>

            <a class="indexterm" name="idm46444421053840"></a>

            <a class="link" href="programs.html#option_myisamchk_silent"><code class="option">--silent</code></a>,
            <code class="option">-s</code>
          </p><p>
            Silent mode. Write output only when errors occur. You can
            use <code class="option">-s</code> twice (<code class="option">-ss</code>) to make
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> very silent.
          </p></li><li class="listitem"><p><a name="option_myisamchk_verbose"></a>
            <a class="indexterm" name="idm46444421047232"></a>

            <a class="indexterm" name="idm46444421045744"></a>

            <a class="link" href="programs.html#option_myisamchk_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does. This can be used with <code class="option">-d</code> and
            <code class="option">-e</code>. Use <code class="option">-v</code> multiple times
            (<code class="option">-vv</code>, <code class="option">-vvv</code>) for even more
            output.
          </p></li><li class="listitem"><p><a name="option_myisamchk_version"></a>
            <a class="indexterm" name="idm46444421038960"></a>

            <a class="indexterm" name="idm46444421037472"></a>

            <a class="link" href="programs.html#option_myisamchk_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_myisamchk_wait"></a>
            <a class="indexterm" name="idm46444421032912"></a>

            <a class="indexterm" name="idm46444421031456"></a>

            <a class="link" href="programs.html#option_myisamchk_wait"><code class="option">--wait</code></a>,
            <code class="option">-w</code>
          </p><p>
            Instead of terminating with an error if the table is locked,
            wait until the table is unlocked before continuing. If you
            are running <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with external locking
            disabled, the table can be locked only by another
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> command.
</p></li></ul>
</div>
<p>
        You can also set the following variables by using
        <code class="option">--<em class="replaceable"><code>var_name</code></em>=<em class="replaceable"><code>value</code></em></code>
        syntax:
</p><a class="indexterm" name="idm46444421023408"></a><a class="indexterm" name="idm46444421022320"></a><a class="indexterm" name="idm46444421021232"></a><a class="indexterm" name="idm46444421020144"></a><a class="indexterm" name="idm46444421019056"></a><a class="indexterm" name="idm46444421017968"></a><a class="indexterm" name="idm46444421016880"></a><a class="indexterm" name="idm46444421015792"></a><a class="indexterm" name="idm46444421014704"></a><a class="indexterm" name="idm46444421013600"></a><a class="indexterm" name="idm46444421012512"></a><a class="indexterm" name="idm46444421011424"></a>
<div class="informaltable">
<table summary="myisamchk variables that can be set using --var_name=value syntax. The table also provides the default value for each variable."><col width="35%"><col width="35%"><thead><tr>
            <th scope="col">Variable</th>
            <th scope="col">Default Value</th>
          </tr></thead><tbody><tr>
            <td scope="row"><code class="literal">decode_bits</code></td>
            <td>9</td>
          </tr><tr>
            <td scope="row"><code class="literal">ft_max_word_len</code></td>
            <td>version-dependent</td>
          </tr><tr>
            <td scope="row"><code class="literal">ft_min_word_len</code></td>
            <td>4</td>
          </tr><tr>
            <td scope="row"><code class="literal">ft_stopword_file</code></td>
            <td>built-in list</td>
          </tr><tr>
            <td scope="row"><code class="literal">key_buffer_size</code></td>
            <td>523264</td>
          </tr><tr>
            <td scope="row"><code class="literal">myisam_block_size</code></td>
            <td>1024</td>
          </tr><tr>
            <td scope="row"><code class="literal">myisam_sort_key_blocks</code></td>
            <td>16</td>
          </tr><tr>
            <td scope="row"><code class="literal">read_buffer_size</code></td>
            <td>262136</td>
          </tr><tr>
            <td scope="row"><code class="literal">sort_buffer_size</code></td>
            <td>2097144</td>
          </tr><tr>
            <td scope="row"><code class="literal">sort_key_blocks</code></td>
            <td>16</td>
          </tr><tr>
            <td scope="row"><code class="literal">stats_method</code></td>
            <td>nulls_unequal</td>
          </tr><tr>
            <td scope="row"><code class="literal">write_buffer_size</code></td>
            <td>262136</td>
</tr></tbody></table>
</div>
<p>
        The possible <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> variables and their
        default values can be examined with <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk
        --help</strong></span></a>:
      </p><p>
        <code class="literal">myisam_sort_buffer_size</code> is used when the keys
        are repaired by sorting keys, which is the normal case when you
        use <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>.
        <code class="literal">sort_buffer_size</code> is a deprecated synonym for
        <code class="literal">myisam_sort_buffer_size</code>.
      </p><p>
        <code class="literal">key_buffer_size</code> is used when you are checking
        the table with <a class="link" href="programs.html#option_myisamchk_extend-check"><code class="option">--extend-check</code></a>
        or when the keys are repaired by inserting keys row by row into
        the table (like when doing normal inserts). Repairing through
        the key buffer is used in the following cases:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            You use <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a>.
          </p></li><li class="listitem"><p>
            The temporary files needed to sort the keys would be more
            than twice as big as when creating the key file directly.
            This is often the case when you have large key values for
            <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a>,
            <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a>, or
            <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">TEXT</code></a> columns, because the
            sort operation needs to store the complete key values as it
            proceeds. If you have lots of temporary space and you can
            force <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to repair by sorting, you
            can use the <a class="link" href="programs.html#option_myisamchk_sort-recover"><code class="option">--sort-recover</code></a>
            option.
</p></li></ul>
</div>
<p>
        Repairing through the key buffer takes much less disk space than
        using sorting, but is also much slower.
      </p><p>
        If you want a faster repair, set the
        <code class="literal">key_buffer_size</code> and
        <code class="literal">myisam_sort_buffer_size</code> variables to about
        25% of your available memory. You can set both variables to
        large values, because only one of them is used at a time.
      </p><p>
        <code class="literal">myisam_block_size</code> is the size used for index
        blocks.
      </p><p>
        <code class="literal">stats_method</code> influences how
        <code class="literal">NULL</code> values are treated for index statistics
        collection when the <a class="link" href="programs.html#option_myisamchk_analyze"><code class="option">--analyze</code></a>
        option is given. It acts like the
        <code class="literal">myisam_stats_method</code> system variable. For more
        information, see the description of
        <code class="literal">myisam_stats_method</code> in
        <a class="xref" href="server-administration.html#server-system-variables" title="5.1.8 Server System Variables">Section 5.1.8, “Server System Variables”</a>, and
        <a class="xref" href="optimization.html#index-statistics" title="8.3.8 InnoDB and MyISAM Index Statistics Collection">Section 8.3.8, “InnoDB and MyISAM Index Statistics Collection”</a>.
      </p><p>
        <code class="literal">ft_min_word_len</code> and
        <code class="literal">ft_max_word_len</code> indicate the minimum and
        maximum word length for <code class="literal">FULLTEXT</code> indexes on
        <code class="literal">MyISAM</code> tables.
        <code class="literal">ft_stopword_file</code> names the stopword file.
        These need to be set under the following circumstances.
      </p><p>
        If you use <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to perform an operation
        that modifies table indexes (such as repair or analyze), the
        <code class="literal">FULLTEXT</code> indexes are rebuilt using the
        default full-text parameter values for minimum and maximum word
        length and the stopword file unless you specify otherwise. This
        can result in queries failing.
      </p><p>
        The problem occurs because these parameters are known only by
        the server. They are not stored in <code class="literal">MyISAM</code>
        index files. To avoid the problem if you have modified the
        minimum or maximum word length or the stopword file in the
        server, specify the same <code class="literal">ft_min_word_len</code>,
        <code class="literal">ft_max_word_len</code>, and
        <code class="literal">ft_stopword_file</code> values to
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> that you use for
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. For example, if you have set the
        minimum word length to 3, you can repair a table with
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk --recover --ft_min_word_len=3 <em class="replaceable"><code>tbl_name</code></em>.MYI</code></strong>
</pre><p>
        To ensure that <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> and the server use
        the same values for full-text parameters, you can place each one
        in both the <code class="literal">[mysqld]</code> and
        <code class="literal">[myisamchk]</code> sections of an option file:
      </p><pre data-lang="ini" class="programlisting">[mysqld]
ft_min_word_len=3

[myisamchk]
ft_min_word_len=3</pre><p>
        An alternative to using <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> is to use
        the <a class="link" href="sql-statements.html#repair-table" title="13.7.3.5 REPAIR TABLE Statement"><code class="literal">REPAIR TABLE</code></a>,
        <a class="link" href="sql-statements.html#analyze-table" title="13.7.3.1 ANALYZE TABLE Statement"><code class="literal">ANALYZE TABLE</code></a>,
        <a class="link" href="sql-statements.html#optimize-table" title="13.7.3.4 OPTIMIZE TABLE Statement"><code class="literal">OPTIMIZE TABLE</code></a>, or
        <a class="link" href="sql-statements.html#alter-table" title="13.1.9 ALTER TABLE Statement"><code class="literal">ALTER TABLE</code></a>. These statements are
        performed by the server, which knows the proper full-text
        parameter values to use.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="myisamchk-check-options"></a>4.6.4.2 myisamchk Check Options</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420914912"></a><a class="indexterm" name="idm46444420913424"></a><p>
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> supports the following options for
        table checking operations:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisamchk_check"></a>
            <a class="indexterm" name="idm46444420909024"></a>

            <a class="indexterm" name="idm46444420907568"></a>

            <a class="link" href="programs.html#option_myisamchk_check"><code class="option">--check</code></a>,
            <code class="option">-c</code>
          </p><p>
            Check the table for errors. This is the default operation if
            you specify no option that selects an operation type
            explicitly.
          </p></li><li class="listitem"><p><a name="option_myisamchk_check-only-changed"></a>
            <a class="indexterm" name="idm46444420902944"></a>

            <a class="indexterm" name="idm46444420901488"></a>

            <a class="link" href="programs.html#option_myisamchk_check-only-changed"><code class="option">--check-only-changed</code></a>,
            <code class="option">-C</code>
          </p><p>
            Check only tables that have changed since the last check.
          </p></li><li class="listitem"><p><a name="option_myisamchk_extend-check"></a>
            <a class="indexterm" name="idm46444420896912"></a>

            <a class="indexterm" name="idm46444420895424"></a>

            <a class="link" href="programs.html#option_myisamchk_extend-check"><code class="option">--extend-check</code></a>,
            <code class="option">-e</code>
          </p><p>
            Check the table very thoroughly. This is quite slow if the
            table has many indexes. This option should only be used in
            extreme cases. Normally, <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> or
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk --medium-check</strong></span></a> should be able
            to determine whether there are any errors in the table.
          </p><p>
            If you are using
            <a class="link" href="programs.html#option_myisamchk_extend-check"><code class="option">--extend-check</code></a> and have
            plenty of memory, setting the
            <code class="literal">key_buffer_size</code> variable to a large value
            helps the repair operation run faster.
          </p><p>
            See also the description of this option under table repair
            options.
          </p><p>
            For a description of the output format, see
            <a class="xref" href="programs.html#myisamchk-table-info" title="4.6.4.5 Obtaining Table Information with myisamchk">Section 4.6.4.5, “Obtaining Table Information with myisamchk”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_fast"></a>
            <a class="indexterm" name="idm46444420884144"></a>

            <a class="indexterm" name="idm46444420882688"></a>

            <a class="link" href="programs.html#option_myisamchk_fast"><code class="option">--fast</code></a>,
            <code class="option">-F</code>
          </p><p>
            Check only tables that haven't been closed properly.
          </p></li><li class="listitem"><p><a name="option_myisamchk_force"></a>
            <a class="indexterm" name="idm46444420878208"></a>

            <a class="indexterm" name="idm46444420876752"></a>

            <a class="link" href="programs.html#option_myisamchk_force"><code class="option">--force</code></a>,
            <code class="option">-f</code>
          </p><p>
            Do a repair operation automatically if
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> finds any errors in the table.
            The repair type is the same as that specified with the
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a> or
            <code class="option">-r</code> option.
          </p></li><li class="listitem"><p><a name="option_myisamchk_information"></a>
            <a class="indexterm" name="idm46444420869440"></a>

            <a class="indexterm" name="idm46444420867952"></a>

            <a class="link" href="programs.html#option_myisamchk_information"><code class="option">--information</code></a>,
            <code class="option">-i</code>
          </p><p>
            Print informational statistics about the table that is
            checked.
          </p></li><li class="listitem"><p><a name="option_myisamchk_medium-check"></a>
            <a class="indexterm" name="idm46444420863424"></a>

            <a class="indexterm" name="idm46444420861936"></a>

            <a class="link" href="programs.html#option_myisamchk_medium-check"><code class="option">--medium-check</code></a>,
            <code class="option">-m</code>
          </p><p>
            Do a check that is faster than an
            <a class="link" href="programs.html#option_myisamchk_extend-check"><code class="option">--extend-check</code></a> operation.
            This finds only 99.99% of all errors, which should be good
            enough in most cases.
          </p></li><li class="listitem"><p><a name="option_myisamchk_read-only"></a>
            <a class="indexterm" name="idm46444420856272"></a>

            <a class="indexterm" name="idm46444420854784"></a>

            <a class="link" href="programs.html#option_myisamchk_read-only"><code class="option">--read-only</code></a>,
            <code class="option">-T</code>
          </p><p>
            Do not mark the table as checked. This is useful if you use
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to check a table that is in use
            by some other application that does not use locking, such as
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> when run with external locking
            disabled.
          </p></li><li class="listitem"><p><a name="option_myisamchk_update-state"></a>
            <a class="indexterm" name="idm46444420847664"></a>

            <a class="indexterm" name="idm46444420846176"></a>

            <a class="link" href="programs.html#option_myisamchk_update-state"><code class="option">--update-state</code></a>,
            <code class="option">-U</code>
          </p><p>
            Store information in the <code class="filename">.MYI</code> file to
            indicate when the table was checked and whether the table
            crashed. This should be used to get full benefit of the
            <a class="link" href="programs.html#option_myisamchk_check-only-changed"><code class="option">--check-only-changed</code></a>
            option, but you shouldn't use this option if the
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server is using the table and you
            are running it with external locking disabled.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="myisamchk-repair-options"></a>4.6.4.3 myisamchk Repair Options</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420838208"></a><a class="indexterm" name="idm46444420836720"></a><p>
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> supports the following options for
        table repair operations (operations performed when an option
        such as <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a> or
        <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a> is given):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisamchk_backup"></a>
            <a class="indexterm" name="idm46444420830304"></a>

            <a class="indexterm" name="idm46444420828848"></a>

            <a class="link" href="programs.html#option_myisamchk_backup"><code class="option">--backup</code></a>,
            <code class="option">-B</code>
          </p><p>
            Make a backup of the <code class="filename">.MYD</code> file as
            <code class="filename"><em class="replaceable"><code>file_name</code></em>-<em class="replaceable"><code>time</code></em>.BAK</code>
          </p></li><li class="listitem"><p><a name="option_myisamchk_character-sets-dir"></a>
            <a class="indexterm" name="idm46444420822256"></a>

            <a class="indexterm" name="idm46444420820800"></a>

            <a class="link" href="programs.html#option_myisamchk_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_correct-checksum"></a>
            <a class="indexterm" name="idm46444420815488"></a>

            <a class="indexterm" name="idm46444420814000"></a>

            <a class="link" href="programs.html#option_myisamchk_correct-checksum"><code class="option">--correct-checksum</code></a>
          </p><p>
            Correct the checksum information for the table.
          </p></li><li class="listitem"><p><a name="option_myisamchk_data-file-length"></a>
            <a class="indexterm" name="idm46444420809856"></a>

            <a class="indexterm" name="idm46444420808368"></a>

            <a class="link" href="programs.html#option_myisamchk_data-file-length"><code class="option">--data-file-length=<em class="replaceable"><code>len</code></em></code></a>,
            <code class="option">-D <em class="replaceable"><code>len</code></em></code>
          </p><p>
            The maximum length of the data file (when re-creating data
            file when it is <span class="quote">“<span class="quote">full</span>”</span>).
          </p></li><li class="listitem"><p>


            <a class="indexterm" name="idm46444420803232"></a>

            <a class="indexterm" name="idm46444420801744"></a>

            <a class="link" href="programs.html#option_myisamchk_extend-check"><code class="option">--extend-check</code></a>,
            <code class="option">-e</code>
          </p><p>
            Do a repair that tries to recover every possible row from
            the data file. Normally, this also finds a lot of garbage
            rows. Do not use this option unless you are desperate.
          </p><p>
            See also the description of this option under table checking
            options.
          </p><p>
            For a description of the output format, see
            <a class="xref" href="programs.html#myisamchk-table-info" title="4.6.4.5 Obtaining Table Information with myisamchk">Section 4.6.4.5, “Obtaining Table Information with myisamchk”</a>.
          </p></li><li class="listitem"><p>
            <a class="indexterm" name="idm46444420795840"></a>

            <a class="indexterm" name="idm46444420794352"></a>

            <a class="link" href="programs.html#option_myisamchk_force"><code class="option">--force</code></a>,
            <code class="option">-f</code>
          </p><p>
            Overwrite old intermediate files (files with names like
            <code class="filename"><em class="replaceable"><code>tbl_name</code></em>.TMD</code>)
            instead of aborting.
          </p></li><li class="listitem"><p><a name="option_myisamchk_keys-used"></a>
            <a class="indexterm" name="idm46444420788784"></a>

            <a class="indexterm" name="idm46444420787296"></a>

            <a class="link" href="programs.html#option_myisamchk_keys-used"><code class="option">--keys-used=<em class="replaceable"><code>val</code></em></code></a>,
            <code class="option">-k <em class="replaceable"><code>val</code></em></code>
          </p><p>
            For <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>, the option value is a bit
            value that indicates which indexes to update. Each binary
            bit of the option value corresponds to a table index, where
            the first index is bit 0. An option value of 0 disables
            updates to all indexes, which can be used to get faster
            inserts. Deactivated indexes can be reactivated by using
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -r</strong></span></a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_no-symlinks"></a>
            <a class="indexterm" name="idm46444420779408"></a>

            <a class="indexterm" name="idm46444420777920"></a>

            <a class="link" href="programs.html#option_myisamchk_no-symlinks"><code class="option">--no-symlinks</code></a>,
            <code class="option">-l</code>
          </p><p>
            Do not follow symbolic links. Normally
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> repairs the table that a
            symlink points to. This option does not exist as of MySQL
            4.0 because versions from 4.0 on do not remove symlinks
            during repair operations.
          </p></li><li class="listitem"><p><a name="option_myisamchk_max-record-length"></a>
            <a class="indexterm" name="idm46444420771872"></a>

            <a class="indexterm" name="idm46444420770416"></a>

            <a class="link" href="programs.html#option_myisamchk_max-record-length"><code class="option">--max-record-length=<em class="replaceable"><code>len</code></em></code></a>
          </p><p>
            Skip rows larger than the given length if
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> cannot allocate memory to hold
            them.
          </p></li><li class="listitem"><p><a name="option_myisamchk_parallel-recover"></a>
            <a class="indexterm" name="idm46444420764736"></a>

            <a class="indexterm" name="idm46444420763248"></a>

            <a class="link" href="programs.html#option_myisamchk_parallel-recover"><code class="option">--parallel-recover</code></a>,
            <code class="option">-p</code>
          </p><p>
            Use the same technique as <code class="option">-r</code> and
            <code class="option">-n</code>, but create all the keys in parallel,
            using different threads. <span class="emphasis"><em>This is beta-quality
            code. Use at your own risk!</em></span>
          </p></li><li class="listitem"><p><a name="option_myisamchk_quick"></a>
            <a class="indexterm" name="idm46444420757408"></a>

            <a class="indexterm" name="idm46444420755952"></a>

            <a class="link" href="programs.html#option_myisamchk_quick"><code class="option">--quick</code></a>,
            <code class="option">-q</code>
          </p><p>
            Achieve a faster repair by modifying only the index file,
            not the data file. You can specify this option twice to
            force <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to modify the original
            data file in case of duplicate keys.
          </p></li><li class="listitem"><p><a name="option_myisamchk_recover"></a>
            <a class="indexterm" name="idm46444420750048"></a>

            <a class="indexterm" name="idm46444420748560"></a>

            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>,
            <code class="option">-r</code>
          </p><p>
            Do a repair that can fix almost any problem except unique
            keys that are not unique (which is an extremely unlikely
            error with <code class="literal">MyISAM</code> tables). If you want to
            recover a table, this is the option to try first. You should
            try <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a> only if
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> reports that the table cannot
            be recovered using
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>. (In the
            unlikely case that
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a> fails, the data
            file remains intact.)
          </p><p>
            If you have lots of memory, you should increase the value of
            <code class="literal">myisam_sort_buffer_size</code>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_safe-recover"></a>
            <a class="indexterm" name="idm46444420737600"></a>

            <a class="indexterm" name="idm46444420736112"></a>

            <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a>,
            <code class="option">-o</code>
          </p><p>
            Do a repair using an old recovery method that reads through
            all rows in order and updates all index trees based on the
            rows found. This is an order of magnitude slower than
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>, but can handle
            a couple of very unlikely cases that
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a> cannot. This
            recovery method also uses much less disk space than
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>. Normally, you
            should repair first using
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>, and then with
            <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a> only if
            <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a> fails.
          </p><p>
            If you have lots of memory, you should increase the value of
            <code class="literal">key_buffer_size</code>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_set-collation"></a>
            <a class="indexterm" name="idm46444420724096"></a>

            <a class="indexterm" name="idm46444420722608"></a>

            <a class="link" href="programs.html#option_myisamchk_set-collation"><code class="option">--set-collation=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Specify the collation to use for sorting table indexes. The
            character set name is implied by the first part of the
            collation name.
          </p></li><li class="listitem"><p><a name="option_myisamchk_sort-recover"></a>
            <a class="indexterm" name="idm46444420718128"></a>

            <a class="indexterm" name="idm46444420716640"></a>

            <a class="link" href="programs.html#option_myisamchk_sort-recover"><code class="option">--sort-recover</code></a>,
            <code class="option">-n</code>
          </p><p>
            Force <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to use sorting to resolve
            the keys even if the temporary files would be very large.
          </p></li><li class="listitem"><p><a name="option_myisamchk_tmpdir"></a>
            <a class="indexterm" name="idm46444420710848"></a>

            <a class="indexterm" name="idm46444420709392"></a>

            <a class="link" href="programs.html#option_myisamchk_tmpdir"><code class="option">--tmpdir=<em class="replaceable"><code>dir_name</code></em></code></a>,
            <code class="option">-t <em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            The path of the directory to be used for storing temporary
            files. If this is not set, <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> uses
            the value of the <code class="literal">TMPDIR</code> environment
            variable. <a class="link" href="programs.html#option_myisamchk_tmpdir"><code class="option">--tmpdir</code></a> can be
            set to a list of directory paths that are used successively
            in round-robin fashion for creating temporary files. The
            separator character between directory names is the colon
            (<code class="literal">:</code>) on Unix and the semicolon
            (<code class="literal">;</code>) on Windows.
          </p></li><li class="listitem"><p><a name="option_myisamchk_unpack"></a>
            <a class="indexterm" name="idm46444420699664"></a>

            <a class="indexterm" name="idm46444420698208"></a>

            <a class="link" href="programs.html#option_myisamchk_unpack"><code class="option">--unpack</code></a>,
            <code class="option">-u</code>
          </p><p>
            Unpack a table that was packed with
            <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="myisamchk-other-options"></a>4.6.4.4 Other myisamchk Options</h4>

</div>

</div>

</div>
<p>
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> supports the following options for
        actions other than table checks and repairs:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisamchk_analyze"></a>
            <a class="indexterm" name="idm46444420689232"></a>

            <a class="indexterm" name="idm46444420687744"></a>

            <a class="link" href="programs.html#option_myisamchk_analyze"><code class="option">--analyze</code></a>,
            <code class="option">-a</code>
          </p><p>
            Analyze the distribution of key values. This improves join
            performance by enabling the join optimizer to better choose
            the order in which to join the tables and which indexes it
            should use. To obtain information about the key
            distribution, use a <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk --description
            --verbose <em class="replaceable"><code>tbl_name</code></em></strong></span></a>
            command or the <code class="literal">SHOW INDEX FROM
            <em class="replaceable"><code>tbl_name</code></em></code> statement.
          </p></li><li class="listitem"><p><a name="option_myisamchk_block-search"></a>
            <a class="indexterm" name="idm46444420680352"></a>

            <a class="indexterm" name="idm46444420678864"></a>

            <a class="link" href="programs.html#option_myisamchk_block-search"><code class="option">--block-search=<em class="replaceable"><code>offset</code></em></code></a>,
            <code class="option">-b <em class="replaceable"><code>offset</code></em></code>
          </p><p>
            Find the record that a block at the given offset belongs to.
          </p></li><li class="listitem"><p><a name="option_myisamchk_description"></a>
            <a class="indexterm" name="idm46444420673728"></a>

            <a class="indexterm" name="idm46444420672240"></a>

            <a class="link" href="programs.html#option_myisamchk_description"><code class="option">--description</code></a>,
            <code class="option">-d</code>
          </p><p>
            Print some descriptive information about the table.
            Specifying the <a class="link" href="programs.html#option_myisamchk_verbose"><code class="option">--verbose</code></a>
            option once or twice produces additional information. See
            <a class="xref" href="programs.html#myisamchk-table-info" title="4.6.4.5 Obtaining Table Information with myisamchk">Section 4.6.4.5, “Obtaining Table Information with myisamchk”</a>.
          </p></li><li class="listitem"><p><a name="option_myisamchk_set-auto-increment"></a>
            <a class="indexterm" name="idm46444420665920"></a>

            <a class="indexterm" name="idm46444420664464"></a>

            <a class="link" href="programs.html#option_myisamchk_set-auto-increment"><code class="option">--set-auto-increment[=<em class="replaceable"><code>value</code></em>]</code></a>,
            <code class="option">-A[<em class="replaceable"><code>value</code></em>]</code>
          </p><p>
            Force <code class="literal">AUTO_INCREMENT</code> numbering for new
            records to start at the given value (or higher, if there are
            existing records with <code class="literal">AUTO_INCREMENT</code>
            values this large). If <em class="replaceable"><code>value</code></em> is
            not specified, <code class="literal">AUTO_INCREMENT</code> numbers for
            new records begin with the largest value currently in the
            table, plus one.
          </p></li><li class="listitem"><p><a name="option_myisamchk_sort-index"></a>
            <a class="indexterm" name="idm46444420656256"></a>

            <a class="indexterm" name="idm46444420654768"></a>

            <a class="link" href="programs.html#option_myisamchk_sort-index"><code class="option">--sort-index</code></a>,
            <code class="option">-S</code>
          </p><p>
            Sort the index tree blocks in high-low order. This optimizes
            seeks and makes table scans that use indexes faster.
          </p></li><li class="listitem"><p><a name="option_myisamchk_sort-records"></a>
            <a class="indexterm" name="idm46444420650128"></a>

            <a class="indexterm" name="idm46444420648640"></a>

            <a class="link" href="programs.html#option_myisamchk_sort-records"><code class="option">--sort-records=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-R <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Sort records according to a particular index. This makes
            your data much more localized and may speed up range-based
            <a class="link" href="sql-statements.html#select" title="13.2.10 SELECT Statement"><code class="literal">SELECT</code></a> and <code class="literal">ORDER
            BY</code> operations that use this index. (The first time
            you use this option to sort a table, it may be very slow.)
            To determine a table's index numbers, use
            <a class="link" href="sql-statements.html#show-index" title="13.7.7.22 SHOW INDEX Statement"><code class="literal">SHOW INDEX</code></a>, which displays a
            table's indexes in the same order that
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> sees them. Indexes are numbered
            beginning with 1.
          </p><p>
            If keys are not packed (<code class="literal">PACK_KEYS=0</code>),
            they have the same length, so when
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> sorts and moves records, it
            just overwrites record offsets in the index. If keys are
            packed (<code class="literal">PACK_KEYS=1</code>),
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> must unpack key blocks first,
            then re-create indexes and pack the key blocks again. (In
            this case, re-creating indexes is faster than updating
            offsets for each index.)
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="myisamchk-table-info"></a>4.6.4.5 Obtaining Table Information with myisamchk</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420633760"></a><a class="indexterm" name="idm46444420632304"></a><a class="indexterm" name="idm46444420630816"></a><a class="indexterm" name="idm46444420629328"></a><p>
        To obtain a description of a <code class="literal">MyISAM</code> table or
        statistics about it, use the commands shown here. The output
        from these commands is explained later in this section.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -d
            <em class="replaceable"><code>tbl_name</code></em></strong></span></a>
          </p><p>
            Runs <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> in <span class="quote">“<span class="quote">describe
            mode</span>”</span> to produce a description of your table. If you
            start the MySQL server with external locking disabled,
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> may report an error for a table
            that is updated while it runs. However, because
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> does not change the table in
            describe mode, there is no risk of destroying data.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -dv
            <em class="replaceable"><code>tbl_name</code></em></strong></span></a>
          </p><p>
            Adding <code class="option">-v</code> runs <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>
            in verbose mode so that it produces more information about
            the table. Adding <code class="option">-v</code> a second time produces
            even more information.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -eis
            <em class="replaceable"><code>tbl_name</code></em></strong></span></a>
          </p><p>
            Shows only the most important information from a table. This
            operation is slow because it must read the entire table.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -eiv
            <em class="replaceable"><code>tbl_name</code></em></strong></span></a>
          </p><p>
            This is like <code class="option">-eis</code>, but tells you what is
            being done.
</p></li></ul>
</div>
<p>
        The <em class="replaceable"><code>tbl_name</code></em> argument can be either
        the name of a <code class="literal">MyISAM</code> table or the name of its
        index file, as described in <a class="xref" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility">Section 4.6.4, “<span class="command"><strong>myisamchk</strong></span> — MyISAM Table-Maintenance Utility”</a>.
        Multiple <em class="replaceable"><code>tbl_name</code></em> arguments can be
        given.
      </p><p>
        Suppose that a table named <code class="literal">person</code> has the
        following structure. (The <code class="literal">MAX_ROWS</code> table
        option is included so that in the example output from
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> shown later, some values are
        smaller and fit the output format more easily.)
      </p><pre data-lang="sql" class="programlisting">CREATE TABLE person
(
  id         INT NOT NULL AUTO_INCREMENT,
  last_name  VARCHAR(20) NOT NULL,
  first_name VARCHAR(20) NOT NULL,
  birth      DATE,
  death      DATE,
  PRIMARY KEY (id),
  INDEX (last_name, first_name),
  INDEX (birth)
) MAX_ROWS = 1000000 ENGINE=MYISAM;</pre><p>
        Suppose also that the table has these data and index file sizes:
      </p><pre data-lang="terminal" class="programlisting">-rw-rw----  1 mysql  mysql  9347072 Aug 19 11:47 person.MYD
-rw-rw----  1 mysql  mysql  6066176 Aug 19 11:47 person.MYI</pre><p>
        Example of <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -dvv</strong></span></a> output:
      </p><pre data-lang="none" class="programlisting">MyISAM file:         person
Record format:       Packed
Character set:       utf8mb4_0900_ai_ci (255)
File-version:        1
Creation time:       2017-03-30 21:21:30
Status:              checked,analyzed,optimized keys,sorted index pages
Auto increment key:              1  Last value:                306688
Data records:               306688  Deleted blocks:                 0
Datafile parts:             306688  Deleted data:                   0
Datafile pointer (bytes):        4  Keyfile pointer (bytes):        3
Datafile length:           9347072  Keyfile length:           6066176
Max datafile length:    4294967294  Max keyfile length:   17179868159
Recordlength:                   54

table description:
Key Start Len Index   Type                     Rec/key         Root  Blocksize
1   2     4   unique  long                           1                    1024
2   6     80  multip. varchar prefix                 0                    1024
    87    80          varchar                        0
3   168   3   multip. uint24 NULL                    0                    1024

Field Start Length Nullpos Nullbit Type
1     1     1                                                         
2     2     4                      no zeros                           
3     6     81                     varchar                            
4     87    81                     varchar                            
5     168   3      1       1       no zeros                           
6     171   3      1       2       no zeros                           </pre><p>
        Explanations for the types of information
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> produces are given here.
        <span class="quote">“<span class="quote">Keyfile</span>”</span> refers to the index file.
        <span class="quote">“<span class="quote">Record</span>”</span> and <span class="quote">“<span class="quote">row</span>”</span> are synonymous, as
        are <span class="quote">“<span class="quote">field</span>”</span> and <span class="quote">“<span class="quote">column.</span>”</span>
      </p><p>
        The initial part of the table description contains these values:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">MyISAM file</code>
          </p><p>
            Name of the <code class="literal">MyISAM</code> (index) file.
          </p></li><li class="listitem"><p>
            <code class="literal">Record format</code>
          </p><p>
            The format used to store table rows. The preceding examples
            use <code class="literal">Fixed length</code>. Other possible values
            are <code class="literal">Compressed</code> and
            <code class="literal">Packed</code>. (<code class="literal">Packed</code>
            corresponds to what <code class="literal">SHOW TABLE STATUS</code>
            reports as <code class="literal">Dynamic</code>.)
          </p></li><li class="listitem"><p>
            <code class="literal">Chararacter set</code>
          </p><p>
            The table default character set.
          </p></li><li class="listitem"><p>
            <code class="literal">File-version</code>
          </p><p>
            Version of <code class="literal">MyISAM</code> format. Always 1.
          </p></li><li class="listitem"><p>
            <code class="literal">Creation time</code>
          </p><p>
            When the data file was created.
          </p></li><li class="listitem"><p>
            <code class="literal">Recover time</code>
          </p><p>
            When the index/data file was last reconstructed.
          </p></li><li class="listitem"><p>
            <code class="literal">Status</code>
          </p><p>
            Table status flags. Possible values are
            <code class="literal">crashed</code>, <code class="literal">open</code>,
            <code class="literal">changed</code>, <code class="literal">analyzed</code>,
            <code class="literal">optimized keys</code>, and <code class="literal">sorted index
            pages</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">Auto increment key</code>, <code class="literal">Last
            value</code>
          </p><p>
            The key number associated the table's
            <code class="literal">AUTO_INCREMENT</code> column, and the most
            recently generated value for this column. These fields do
            not appear if there is no such column.
          </p></li><li class="listitem"><p>
            <code class="literal">Data records</code>
          </p><p>
            The number of rows in the table.
          </p></li><li class="listitem"><p>
            <code class="literal">Deleted blocks</code>
          </p><p>
            How many deleted blocks still have reserved space. You can
            optimize your table to minimize this space. See
            <a class="xref" href="backup-and-recovery.html#myisam-optimization" title="7.6.4 MyISAM Table Optimization">Section 7.6.4, “MyISAM Table Optimization”</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">Datafile parts</code>
          </p><p>
            For dynamic-row format, this indicates how many data blocks
            there are. For an optimized table without fragmented rows,
            this is the same as <code class="literal">Data records</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">Deleted data</code>
          </p><p>
            How many bytes of unreclaimed deleted data there are. You
            can optimize your table to minimize this space. See
            <a class="xref" href="backup-and-recovery.html#myisam-optimization" title="7.6.4 MyISAM Table Optimization">Section 7.6.4, “MyISAM Table Optimization”</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">Datafile pointer</code>
          </p><p>
            The size of the data file pointer, in bytes. It is usually
            2, 3, 4, or 5 bytes. Most tables manage with 2 bytes, but
            this cannot be controlled from MySQL yet. For fixed tables,
            this is a row address. For dynamic tables, this is a byte
            address.
          </p></li><li class="listitem"><p>
            <code class="literal">Keyfile pointer</code>
          </p><p>
            The size of the index file pointer, in bytes. It is usually
            1, 2, or 3 bytes. Most tables manage with 2 bytes, but this
            is calculated automatically by MySQL. It is always a block
            address.
          </p></li><li class="listitem"><p>
            <code class="literal">Max datafile length</code>
          </p><p>
            How long the table data file can become, in bytes.
          </p></li><li class="listitem"><p>
            <code class="literal">Max keyfile length</code>
          </p><p>
            How long the table index file can become, in bytes.
          </p></li><li class="listitem"><p>
            <code class="literal">Recordlength</code>
          </p><p>
            How much space each row takes, in bytes.
</p></li></ul>
</div>
<p>
        The <code class="literal">table description</code> part of the output
        includes a list of all keys in the table. For each key,
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> displays some low-level
        information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">Key</code>
          </p><p>
            This key's number. This value is shown only for the first
            column of the key. If this value is missing, the line
            corresponds to the second or later column of a
            multiple-column key. For the table shown in the example,
            there are two <code class="literal">table description</code> lines for
            the second index. This indicates that it is a multiple-part
            index with two parts.
          </p></li><li class="listitem"><p>
            <code class="literal">Start</code>
          </p><p>
            Where in the row this portion of the index starts.
          </p></li><li class="listitem"><p>
            <code class="literal">Len</code>
          </p><p>
            How long this portion of the index is. For packed numbers,
            this should always be the full length of the column. For
            strings, it may be shorter than the full length of the
            indexed column, because you can index a prefix of a string
            column. The total length of a multiple-part key is the sum
            of the <code class="literal">Len</code> values for all key parts.
          </p></li><li class="listitem"><p>
            <code class="literal">Index</code>
          </p><p>
            Whether a key value can exist multiple times in the index.
            Possible values are <code class="literal">unique</code> or
            <code class="literal">multip.</code> (multiple).
          </p></li><li class="listitem"><p>
            <code class="literal">Type</code>
          </p><p>
            What data type this portion of the index has. This is a
            <code class="literal">MyISAM</code> data type with the possible values
            <code class="literal">packed</code>, <code class="literal">stripped</code>, or
            <code class="literal">empty</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">Root</code>
          </p><p>
            Address of the root index block.
          </p></li><li class="listitem"><p>
            <code class="literal">Blocksize</code>
          </p><p>
            The size of each index block. By default this is 1024, but
            the value may be changed at compile time when MySQL is built
            from source.
          </p></li><li class="listitem"><p>
            <code class="literal">Rec/key</code>
          </p><p>
            This is a statistical value used by the optimizer. It tells
            how many rows there are per value for this index. A unique
            index always has a value of 1. This may be updated after a
            table is loaded (or greatly changed) with <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk
            -a</strong></span></a>. If this is not updated at all, a default value
            of 30 is given.
</p></li></ul>
</div>
<p>
        The last part of the output provides information about each
        column:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">Field</code>
          </p><p>
            The column number.
          </p></li><li class="listitem"><p>
            <code class="literal">Start</code>
          </p><p>
            The byte position of the column within table rows.
          </p></li><li class="listitem"><p>
            <code class="literal">Length</code>
          </p><p>
            The length of the column in bytes.
          </p></li><li class="listitem"><p>
            <code class="literal">Nullpos</code>, <code class="literal">Nullbit</code>
          </p><p>
            For columns that can be <code class="literal">NULL</code>,
            <code class="literal">MyISAM</code> stores <code class="literal">NULL</code>
            values as a flag in a byte. Depending on how many nullable
            columns there are, there can be one or more bytes used for
            this purpose. The <code class="literal">Nullpos</code> and
            <code class="literal">Nullbit</code> values, if nonempty, indicate
            which byte and bit contains that flag indicating whether the
            column is <code class="literal">NULL</code>.
          </p><p>
            The position and number of bytes used to store
            <code class="literal">NULL</code> flags is shown in the line for field
            1. This is why there are six <code class="literal">Field</code> lines
            for the <code class="literal">person</code> table even though it has
            only five columns.
          </p></li><li class="listitem"><p>
            <code class="literal">Type</code>
          </p><p>
            The data type. The value may contain any of the following
            descriptors:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">constant</code>
              </p><p>
                All rows have the same value.
              </p></li><li class="listitem"><p>
                <code class="literal">no endspace</code>
              </p><p>
                Do not store endspace.
              </p></li><li class="listitem"><p>
                <code class="literal">no endspace, not_always</code>
              </p><p>
                Do not store endspace and do not do endspace compression
                for all values.
              </p></li><li class="listitem"><p>
                <code class="literal">no endspace, no empty</code>
              </p><p>
                Do not store endspace. Do not store empty values.
              </p></li><li class="listitem"><p>
                <code class="literal">table-lookup</code>
              </p><p>
                The column was converted to an
                <a class="link" href="data-types.html#enum" title="11.3.5 The ENUM Type"><code class="literal">ENUM</code></a>.
              </p></li><li class="listitem"><p>
                <code class="literal">zerofill(<em class="replaceable"><code>N</code></em>)</code>
              </p><p>
                The most significant <em class="replaceable"><code>N</code></em> bytes
                in the value are always 0 and are not stored.
              </p></li><li class="listitem"><p>
                <code class="literal">no zeros</code>
              </p><p>
                Do not store zeros.
              </p></li><li class="listitem"><p>
                <code class="literal">always zero</code>
              </p><p>
                Zero values are stored using one bit.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">Huff tree</code>
          </p><p>
            The number of the Huffman tree associated with the column.
          </p></li><li class="listitem"><p>
            <code class="literal">Bits</code>
          </p><p>
            The number of bits used in the Huffman tree.
</p></li></ul>
</div>
<p>
        The <code class="literal">Huff tree</code> and <code class="literal">Bits</code>
        fields are displayed if the table has been compressed with
        <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>. See <a class="xref" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables">Section 4.6.6, “<span class="command"><strong>myisampack</strong></span> — Generate Compressed, Read-Only MyISAM Tables”</a>,
        for an example of this information.
      </p><p>
        Example of <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -eiv</strong></span></a> output:
      </p><pre data-lang="none" class="programlisting">Checking MyISAM file: person
Data records:  306688   Deleted blocks:       0
- check file-size
- check record delete-chain
No recordlinks
- check key delete-chain
block_size 1024:
- check index reference
- check data record references index: 1
Key:  1:  Keyblocks used:  98%  Packed:    0%  Max levels:  3
- check data record references index: 2
Key:  2:  Keyblocks used:  99%  Packed:   97%  Max levels:  3
- check data record references index: 3
Key:  3:  Keyblocks used:  98%  Packed:  -14%  Max levels:  3
Total:    Keyblocks used:  98%  Packed:   89%

- check records and index references<em class="replaceable"><code>*** LOTS OF ROW NUMBERS DELETED ***</code></em>

Records:            306688  M.recordlength:       25  Packed:            83%
Recordspace used:       97% Empty space:           2% Blocks/Record:   1.00
Record blocks:      306688  Delete blocks:         0
Record data:       7934464  Deleted data:          0
Lost space:         256512  Linkdata:        1156096

User time 43.08, System time 1.68
Maximum resident set size 0, Integral resident set size 0
Non-physical pagefaults 0, Physical pagefaults 0, Swaps 0
Blocks in 0 out 7, Messages in 0 out 0, Signals 0
Voluntary context switches 0, Involuntary context switches 0
Maximum memory usage: 1046926 bytes (1023k)
</pre><p>
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -eiv</strong></span></a> output includes the following
        information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">Data records</code>
          </p><p>
            The number of rows in the table.
          </p></li><li class="listitem"><p>
            <code class="literal">Deleted blocks</code>
          </p><p>
            How many deleted blocks still have reserved space. You can
            optimize your table to minimize this space. See
            <a class="xref" href="backup-and-recovery.html#myisam-optimization" title="7.6.4 MyISAM Table Optimization">Section 7.6.4, “MyISAM Table Optimization”</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">Key</code>
          </p><p>
            The key number.
          </p></li><li class="listitem"><p>
            <code class="literal">Keyblocks used</code>
          </p><p>
            What percentage of the keyblocks are used. When a table has
            just been reorganized with <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>, the
            values are very high (very near theoretical maximum).
          </p></li><li class="listitem"><p>
            <code class="literal">Packed</code>
          </p><p>
            MySQL tries to pack key values that have a common suffix.
            This can only be used for indexes on
            <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a> and
            <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a> columns. For long
            indexed strings that have similar leftmost parts, this can
            significantly reduce the space used. In the preceding
            example, the second key is 40 bytes long and a 97% reduction
            in space is achieved.
          </p></li><li class="listitem"><p>
            <code class="literal">Max levels</code>
          </p><p>
            How deep the B-tree for this key is. Large tables with long
            key values get high values.
          </p></li><li class="listitem"><p>
            <code class="literal">Records</code>
          </p><p>
            How many rows are in the table.
          </p></li><li class="listitem"><p>
            <code class="literal">M.recordlength</code>
          </p><p>
            The average row length. This is the exact row length for
            tables with fixed-length rows, because all rows have the
            same length.
          </p></li><li class="listitem"><p>
            <code class="literal">Packed</code>
          </p><p>
            MySQL strips spaces from the end of strings. The
            <code class="literal">Packed</code> value indicates the percentage of
            savings achieved by doing this.
          </p></li><li class="listitem"><p>
            <code class="literal">Recordspace used</code>
          </p><p>
            What percentage of the data file is used.
          </p></li><li class="listitem"><p>
            <code class="literal">Empty space</code>
          </p><p>
            What percentage of the data file is unused.
          </p></li><li class="listitem"><p>
            <code class="literal">Blocks/Record</code>
          </p><p>
            Average number of blocks per row (that is, how many links a
            fragmented row is composed of). This is always 1.0 for
            fixed-format tables. This value should stay as close to 1.0
            as possible. If it gets too large, you can reorganize the
            table. See <a class="xref" href="backup-and-recovery.html#myisam-optimization" title="7.6.4 MyISAM Table Optimization">Section 7.6.4, “MyISAM Table Optimization”</a>.
          </p></li><li class="listitem"><p>
            <code class="literal">Recordblocks</code>
          </p><p>
            How many blocks (links) are used. For fixed-format tables,
            this is the same as the number of rows.
          </p></li><li class="listitem"><p>
            <code class="literal">Deleteblocks</code>
          </p><p>
            How many blocks (links) are deleted.
          </p></li><li class="listitem"><p>
            <code class="literal">Recorddata</code>
          </p><p>
            How many bytes in the data file are used.
          </p></li><li class="listitem"><p>
            <code class="literal">Deleted data</code>
          </p><p>
            How many bytes in the data file are deleted (unused).
          </p></li><li class="listitem"><p>
            <code class="literal">Lost space</code>
          </p><p>
            If a row is updated to a shorter length, some space is lost.
            This is the sum of all such losses, in bytes.
          </p></li><li class="listitem"><p>
            <code class="literal">Linkdata</code>
          </p><p>
            When the dynamic table format is used, row fragments are
            linked with pointers (4 to 7 bytes each).
            <code class="literal">Linkdata</code> is the sum of the amount of
            storage used by all such pointers.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="myisamchk-memory"></a>4.6.4.6 myisamchk Memory Usage</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420423152"></a><p>
        Memory allocation is important when you run
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>. <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> uses
        no more memory than its memory-related variables are set to. If
        you are going to use <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> on very large
        tables, you should first decide how much memory you want it to
        use. The default is to use only about 3MB to perform repairs. By
        using larger values, you can get <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to
        operate faster. For example, if you have more than 512MB RAM
        available, you could use options such as these (in addition to
        any other options you might specify):
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk --myisam_sort_buffer_size=256M \</code></strong>
           <strong class="userinput"><code>--key_buffer_size=512M \</code></strong>
           <strong class="userinput"><code>--read_buffer_size=64M \</code></strong>
           <strong class="userinput"><code>--write_buffer_size=64M ...</code></strong>
</pre><p>
        Using <code class="option">--myisam_sort_buffer_size=16M</code> is probably
        enough for most cases.
      </p><p>
        Be aware that <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> uses temporary files
        in <code class="literal">TMPDIR</code>. If <code class="literal">TMPDIR</code>
        points to a memory file system, out of memory errors can easily
        occur. If this happens, run <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> with
        the
        <a class="link" href="programs.html#option_myisamchk_tmpdir"><code class="option">--tmpdir=<em class="replaceable"><code>dir_name</code></em></code></a>
        option to specify a directory located on a file system that has
        more space.
      </p><p>
        When performing repair operations, <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>
        also needs a lot of disk space:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Twice the size of the data file (the original file and a
            copy). This space is not needed if you do a repair with
            <a class="link" href="programs.html#option_myisamchk_quick"><code class="option">--quick</code></a>; in this case,
            only the index file is re-created. <span class="emphasis"><em>This space must
            be available on the same file system as the original data
            file</em></span>, as the copy is created in the same
            directory as the original.
          </p></li><li class="listitem"><p>
            Space for the new index file that replaces the old one. The
            old index file is truncated at the start of the repair
            operation, so you usually ignore this space. This space must
            be available on the same file system as the original data
            file.
          </p></li><li class="listitem"><p>
            When using <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a> or
            <a class="link" href="programs.html#option_myisamchk_sort-recover"><code class="option">--sort-recover</code></a> (but not
            when using
            <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a>), you need
            space on disk for sorting. This space is allocated in the
            temporary directory (specified by <code class="literal">TMPDIR</code>
            or
            <a class="link" href="programs.html#option_myisamchk_tmpdir"><code class="option">--tmpdir=<em class="replaceable"><code>dir_name</code></em></code></a>).
            The following formula yields the amount of space required:
          </p><pre data-lang="clike" class="programlisting">(<em class="replaceable"><code>largest_key</code></em> + <em class="replaceable"><code>row_pointer_length</code></em>) * <em class="replaceable"><code>number_of_rows</code></em> * 2
</pre><p>
            You can check the length of the keys and the
            <em class="replaceable"><code>row_pointer_length</code></em> with
            <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -dv
            <em class="replaceable"><code>tbl_name</code></em></strong></span></a> (see
            <a class="xref" href="programs.html#myisamchk-table-info" title="4.6.4.5 Obtaining Table Information with myisamchk">Section 4.6.4.5, “Obtaining Table Information with myisamchk”</a>). The
            <em class="replaceable"><code>row_pointer_length</code></em> and
            <em class="replaceable"><code>number_of_rows</code></em> values are the
            <code class="literal">Datafile pointer</code> and <code class="literal">Data
            records</code> values in the table description. To
            determine the <em class="replaceable"><code>largest_key</code></em> value,
            check the <code class="literal">Key</code> lines in the table
            description. The <code class="literal">Len</code> column indicates the
            number of bytes for each key part. For a multiple-column
            index, the key size is the sum of the <code class="literal">Len</code>
            values for all key parts.
</p></li></ul>
</div>
<p>
        If you have a problem with disk space during repair, you can try
        <a class="link" href="programs.html#option_myisamchk_safe-recover"><code class="option">--safe-recover</code></a> instead of
        <a class="link" href="programs.html#option_myisamchk_recover"><code class="option">--recover</code></a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="myisamlog"></a>4.6.5 <span class="command"><strong>myisamlog</strong></span> — Display MyISAM Log File Contents</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420378880"></a><p>
        <a class="link" href="programs.html#myisamlog" title="4.6.5 myisamlog — Display MyISAM Log File Contents"><span class="command"><strong>myisamlog</strong></span></a> processes the contents of a
        <code class="literal">MyISAM</code> log file. To create such a file, start
        the server with a
        <a class="link" href="server-administration.html#option_mysqld_log-isam"><code class="option">--log-isam=<code class="filename">log_file</code></code></a>
        option.
      </p><p>
        Invoke <a class="link" href="programs.html#myisamlog" title="4.6.5 myisamlog — Display MyISAM Log File Contents"><span class="command"><strong>myisamlog</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamlog [<em class="replaceable"><code>options</code></em>] [<em class="replaceable"><code>file_name</code></em> [<em class="replaceable"><code>tbl_name</code></em>] ...]</code></strong>
</pre><p>
        The default operation is update (<code class="option">-u</code>). If a
        recovery is done (<code class="option">-r</code>), all writes and possibly
        updates and deletes are done and errors are only counted. The
        default log file name is <code class="filename">myisam.log</code> if no
        <em class="replaceable"><code>log_file</code></em> argument is given. If tables
        are named on the command line, only those tables are updated.
      </p><p>
        <a class="link" href="programs.html#myisamlog" title="4.6.5 myisamlog — Display MyISAM Log File Contents"><span class="command"><strong>myisamlog</strong></span></a> supports the following options:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisamlog_help"></a>
            <code class="option">-?</code>, <code class="option">-I</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_myisamlog_commands"></a>
            <code class="option">-c <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Execute only <em class="replaceable"><code>N</code></em> commands.
          </p></li><li class="listitem"><p><a name="option_myisamlog_files"></a>
            <code class="option">-f <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Specify the maximum number of open files.
          </p></li><li class="listitem"><p><a name="option_myisamlog_filepath"></a>
            <code class="option">-F <em class="replaceable"><code>filepath/</code></em></code>
          </p><p>
            Specify the file path with a trailing slash.
          </p></li><li class="listitem"><p><a name="option_myisamlog_information"></a>
            <code class="option">-i</code>
          </p><p>
            Display extra information before exiting.
          </p></li><li class="listitem"><p><a name="option_myisamlog_offset"></a>
            <code class="option">-o <em class="replaceable"><code>offset</code></em></code>
          </p><p>
            Specify the starting offset.
          </p></li><li class="listitem"><p><a name="option_myisamlog_path"></a>
            <code class="option">-p <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Remove <em class="replaceable"><code>N</code></em> components from path.
          </p></li><li class="listitem"><p><a name="option_myisamlog_recovery"></a>
            <code class="option">-r</code>
          </p><p>
            Perform a recovery operation.
          </p></li><li class="listitem"><p><a name="option_myisamlog_record-position"></a>
            <code class="option">-R <em class="replaceable"><code>record_pos_file
            record_pos</code></em></code>
          </p><p>
            Specify record position file and record position.
          </p></li><li class="listitem"><p><a name="option_myisamlog_update"></a>
            <code class="option">-u</code>
          </p><p>
            Perform an update operation.
          </p></li><li class="listitem"><p><a name="option_myisamlog_verbose"></a>
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more output about what the program does.
            This option can be given multiple times to produce more and
            more output.
          </p></li><li class="listitem"><p><a name="option_myisamlog_write"></a>
            <code class="option">-w <em class="replaceable"><code>write_file</code></em></code>
          </p><p>
            Specify the write file.
          </p></li><li class="listitem"><p><a name="option_myisamlog_version"></a>
            <code class="option">-V</code>
          </p><p>
            Display version information.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="myisampack"></a>4.6.6 <span class="command"><strong>myisampack</strong></span> — Generate Compressed, Read-Only MyISAM Tables</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420332512"></a><a class="indexterm" name="idm46444420331568"></a><a class="indexterm" name="idm46444420330624"></a><a class="indexterm" name="idm46444420329264"></a><p>
        The <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> utility compresses
        <code class="literal">MyISAM</code> tables. <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>
        works by compressing each column in the table separately.
        Usually, <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> packs the data file 40%
        to 70%.
      </p><p>
        When the table is used later, the server reads into memory the
        information needed to decompress columns. This results in much
        better performance when accessing individual rows, because you
        only have to uncompress exactly one row.
      </p><p>
        MySQL uses <code class="literal">mmap()</code> when possible to perform
        memory mapping on compressed tables. If
        <code class="literal">mmap()</code> does not work, MySQL falls back to
        normal read/write file operations.
      </p><p>
        Please note the following:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            If the <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server was invoked with
            external locking disabled, it is not a good idea to invoke
            <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> if the table might be updated
            by the server during the packing process. It is safest to
            compress tables with the server stopped.
          </p></li><li class="listitem"><p>
            After packing a table, it becomes read only. This is
            generally intended (such as when accessing packed tables on
            a CD).
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> does not support partitioned
            tables.
</p></li></ul>
</div>
<p>
        Invoke <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisampack [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>file_name</code></em> ...</code></strong>
</pre><p>
        Each file name argument should be the name of an index
        (<code class="filename">.MYI</code>) file. If you are not in the database
        directory, you should specify the path name to the file. It is
        permissible to omit the <code class="filename">.MYI</code> extension.
      </p><p>
        After you compress a table with <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>,
        use <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -rq</strong></span></a> to rebuild its indexes.
        <a class="xref" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility">Section 4.6.4, “<span class="command"><strong>myisamchk</strong></span> — MyISAM Table-Maintenance Utility”</a>.
      </p><p>
        <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> supports the following options. It
        also reads option files and supports the options for processing
        them described at <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_myisampack_help"></a>
            <a class="indexterm" name="idm46444420299472"></a>

            <a class="indexterm" name="idm46444420298016"></a>

            <a class="link" href="programs.html#option_myisampack_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_myisampack_backup"></a>
            <a class="indexterm" name="idm46444420293328"></a>

            <a class="indexterm" name="idm46444420291840"></a>

            <a class="link" href="programs.html#option_myisampack_backup"><code class="option">--backup</code></a>,
            <code class="option">-b</code>
          </p><p>
            Make a backup of each table's data file using the name
            <code class="filename"><em class="replaceable"><code>tbl_name</code></em>.OLD</code>.
          </p></li><li class="listitem"><p><a name="option_myisampack_character-sets-dir"></a>
            <a class="indexterm" name="idm46444420286144"></a>

            <a class="indexterm" name="idm46444420284688"></a>

            <a class="link" href="programs.html#option_myisampack_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_myisampack_debug"></a>
            <a class="indexterm" name="idm46444420279504"></a>

            <a class="indexterm" name="idm46444420278048"></a>

            <a class="link" href="programs.html#option_myisampack_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is <code class="literal">d:t:o</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_myisampack_force"></a>
            <a class="indexterm" name="idm46444420268400"></a>

            <a class="indexterm" name="idm46444420266944"></a>

            <a class="link" href="programs.html#option_myisampack_force"><code class="option">--force</code></a>,
            <code class="option">-f</code>
          </p><p>
            Produce a packed table even if it becomes larger than the
            original or if the intermediate file from an earlier
            invocation of <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> exists.
            (<a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> creates an intermediate file
            named
            <code class="filename"><em class="replaceable"><code>tbl_name</code></em>.TMD</code>
            in the database directory while it compresses the table. If
            you kill <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>, the
            <code class="filename">.TMD</code> file might not be deleted.)
            Normally, <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> exits with an error
            if it finds that
            <code class="filename"><em class="replaceable"><code>tbl_name</code></em>.TMD</code>
            exists. With <a class="link" href="programs.html#option_myisampack_force"><code class="option">--force</code></a>,
            <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> packs the table anyway.
          </p></li><li class="listitem"><p><a name="option_myisampack_join"></a>
            <a class="indexterm" name="idm46444420252112"></a>

            <a class="indexterm" name="idm46444420250656"></a>

            <a class="link" href="programs.html#option_myisampack_join"><code class="option">--join=<em class="replaceable"><code>big_tbl_name</code></em></code></a>,
            <code class="option">-j <em class="replaceable"><code>big_tbl_name</code></em></code>
          </p><p>
            Join all tables named on the command line into a single
            packed table <em class="replaceable"><code>big_tbl_name</code></em>. All
            tables that are to be combined <span class="emphasis"><em>must</em></span>
            have identical structure (same column names and types, same
            indexes, and so forth).
          </p><p>
            <em class="replaceable"><code>big_tbl_name</code></em> must not exist prior
            to the join operation. All source tables named on the
            command line to be merged into
            <em class="replaceable"><code>big_tbl_name</code></em> must exist. The
            source tables are read for the join operation but not
            modified.
          </p></li><li class="listitem"><p><a name="option_myisampack_silent"></a>
            <a class="indexterm" name="idm46444420242832"></a>

            <a class="indexterm" name="idm46444420241344"></a>

            <a class="link" href="programs.html#option_myisampack_silent"><code class="option">--silent</code></a>,
            <code class="option">-s</code>
          </p><p>
            Silent mode. Write output only when errors occur.
          </p></li><li class="listitem"><p><a name="option_myisampack_test"></a>
            <a class="indexterm" name="idm46444420236704"></a>

            <a class="indexterm" name="idm46444420235248"></a>

            <a class="link" href="programs.html#option_myisampack_test"><code class="option">--test</code></a>,
            <code class="option">-t</code>
          </p><p>
            Do not actually pack the table, just test packing it.
          </p></li><li class="listitem"><p><a name="option_myisampack_tmpdir"></a>
            <a class="indexterm" name="idm46444420230480"></a>

            <a class="indexterm" name="idm46444420228992"></a>

            <a class="link" href="programs.html#option_myisampack_tmpdir"><code class="option">--tmpdir=<em class="replaceable"><code>dir_name</code></em></code></a>,
            <code class="option">-T <em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            Use the named directory as the location where
            <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> creates temporary files.
          </p></li><li class="listitem"><p><a name="option_myisampack_verbose"></a>
            <a class="indexterm" name="idm46444420222496"></a>

            <a class="indexterm" name="idm46444420221008"></a>

            <a class="link" href="programs.html#option_myisampack_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Write information about the progress of the
            packing operation and its result.
          </p></li><li class="listitem"><p><a name="option_myisampack_version"></a>
            <a class="indexterm" name="idm46444420216208"></a>

            <a class="indexterm" name="idm46444420214720"></a>

            <a class="link" href="programs.html#option_myisampack_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p></li><li class="listitem"><p><a name="option_myisampack_wait"></a>
            <a class="indexterm" name="idm46444420210096"></a>

            <a class="indexterm" name="idm46444420208640"></a>

            <a class="link" href="programs.html#option_myisampack_wait"><code class="option">--wait</code></a>,
            <code class="option">-w</code>
          </p><p>
            Wait and retry if the table is in use. If the
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> server was invoked with external
            locking disabled, it is not a good idea to invoke
            <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> if the table might be updated
            by the server during the packing process.
</p></li></ul>
</div>
<a class="indexterm" name="idm46444420202304"></a><p>
        The following sequence of commands illustrates a typical table
        compression session:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>ls -l station.*</code></strong>
-rw-rw-r--   1 jones    my         994128 Apr 17 19:00 station.MYD
-rw-rw-r--   1 jones    my          53248 Apr 17 19:00 station.MYI

shell&gt; <strong class="userinput"><code>myisamchk -dvv station</code></strong>

MyISAM file:     station
Isam-version:  2
Creation time: 1996-03-13 10:08:58
Recover time:  1997-02-02  3:06:43
Data records:              1192  Deleted blocks:              0
Datafile parts:            1192  Deleted data:                0
Datafile pointer (bytes):     2  Keyfile pointer (bytes):     2
Max datafile length:   54657023  Max keyfile length:   33554431
Recordlength:               834
Record format: Fixed length

table description:
Key Start Len Index   Type                 Root  Blocksize    Rec/key
1   2     4   unique  unsigned long        1024       1024          1
2   32    30  multip. text                10240       1024          1

Field Start Length Type
1     1     1
2     2     4
3     6     4
4     10    1
5     11    20
6     31    1
7     32    30
8     62    35
9     97    35
10    132   35
11    167   4
12    171   16
13    187   35
14    222   4
15    226   16
16    242   20
17    262   20
18    282   20
19    302   30
20    332   4
21    336   4
22    340   1
23    341   8
24    349   8
25    357   8
26    365   2
27    367   2
28    369   4
29    373   4
30    377   1
31    378   2
32    380   8
33    388   4
34    392   4
35    396   4
36    400   4
37    404   1
38    405   4
39    409   4
40    413   4
41    417   4
42    421   4
43    425   4
44    429   20
45    449   30
46    479   1
47    480   1
48    481   79
49    560   79
50    639   79
51    718   79
52    797   8
53    805   1
54    806   1
55    807   20
56    827   4
57    831   4

shell&gt; <strong class="userinput"><code>myisampack station.MYI</code></strong>
Compressing station.MYI: (1192 records)
- Calculating statistics

normal:     20  empty-space:   16  empty-zero:     12  empty-fill:  11
pre-space:   0  end-space:     12  table-lookups:   5  zero:         7
Original trees:  57  After join: 17
- Compressing file
87.14%
Remember to run myisamchk -rq on compressed tables

shell&gt; <strong class="userinput"><code>myisamchk -rq station</code></strong>
- check record delete-chain
- recovering (with sort) MyISAM-table 'station'
Data records: 1192
- Fixing index 1
- Fixing index 2

shell&gt; <strong class="userinput"><code>mysqladmin -uroot flush-tables</code></strong>

shell&gt; <strong class="userinput"><code>ls -l station.*</code></strong>
-rw-rw-r--   1 jones    my         127874 Apr 17 19:00 station.MYD
-rw-rw-r--   1 jones    my          55296 Apr 17 19:04 station.MYI

shell&gt; <strong class="userinput"><code>myisamchk -dvv station</code></strong>

MyISAM file:     station
Isam-version:  2
Creation time: 1996-03-13 10:08:58
Recover time:  1997-04-17 19:04:26
Data records:               1192  Deleted blocks:              0
Datafile parts:             1192  Deleted data:                0
Datafile pointer (bytes):      3  Keyfile pointer (bytes):     1
Max datafile length:    16777215  Max keyfile length:     131071
Recordlength:                834
Record format: Compressed

table description:
Key Start Len Index   Type                 Root  Blocksize    Rec/key
1   2     4   unique  unsigned long       10240       1024          1
2   32    30  multip. text                54272       1024          1

Field Start Length Type                         Huff tree  Bits
1     1     1      constant                             1     0
2     2     4      zerofill(1)                          2     9
3     6     4      no zeros, zerofill(1)                2     9
4     10    1                                           3     9
5     11    20     table-lookup                         4     0
6     31    1                                           3     9
7     32    30     no endspace, not_always              5     9
8     62    35     no endspace, not_always, no empty    6     9
9     97    35     no empty                             7     9
10    132   35     no endspace, not_always, no empty    6     9
11    167   4      zerofill(1)                          2     9
12    171   16     no endspace, not_always, no empty    5     9
13    187   35     no endspace, not_always, no empty    6     9
14    222   4      zerofill(1)                          2     9
15    226   16     no endspace, not_always, no empty    5     9
16    242   20     no endspace, not_always              8     9
17    262   20     no endspace, no empty                8     9
18    282   20     no endspace, no empty                5     9
19    302   30     no endspace, no empty                6     9
20    332   4      always zero                          2     9
21    336   4      always zero                          2     9
22    340   1                                           3     9
23    341   8      table-lookup                         9     0
24    349   8      table-lookup                        10     0
25    357   8      always zero                          2     9
26    365   2                                           2     9
27    367   2      no zeros, zerofill(1)                2     9
28    369   4      no zeros, zerofill(1)                2     9
29    373   4      table-lookup                        11     0
30    377   1                                           3     9
31    378   2      no zeros, zerofill(1)                2     9
32    380   8      no zeros                             2     9
33    388   4      always zero                          2     9
34    392   4      table-lookup                        12     0
35    396   4      no zeros, zerofill(1)               13     9
36    400   4      no zeros, zerofill(1)                2     9
37    404   1                                           2     9
38    405   4      no zeros                             2     9
39    409   4      always zero                          2     9
40    413   4      no zeros                             2     9
41    417   4      always zero                          2     9
42    421   4      no zeros                             2     9
43    425   4      always zero                          2     9
44    429   20     no empty                             3     9
45    449   30     no empty                             3     9
46    479   1                                          14     4
47    480   1                                          14     4
48    481   79     no endspace, no empty               15     9
49    560   79     no empty                             2     9
50    639   79     no empty                             2     9
51    718   79     no endspace                         16     9
52    797   8      no empty                             2     9
53    805   1                                          17     1
54    806   1                                           3     9
55    807   20     no empty                             3     9
56    827   4      no zeros, zerofill(2)                2     9
57    831   4      no zeros, zerofill(1)                2     9
</pre><p>
        <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a> displays the following kinds of
        information:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">normal</code>
          </p><p>
            The number of columns for which no extra packing is used.
          </p></li><li class="listitem"><p>
            <code class="literal">empty-space</code>
          </p><p>
            The number of columns containing values that are only
            spaces. These occupy one bit.
          </p></li><li class="listitem"><p>
            <code class="literal">empty-zero</code>
          </p><p>
            The number of columns containing values that are only binary
            zeros. These occupy one bit.
          </p></li><li class="listitem"><p>
            <code class="literal">empty-fill</code>
          </p><p>
            The number of integer columns that do not occupy the full
            byte range of their type. These are changed to a smaller
            type. For example, a <a class="link" href="data-types.html#integer-types" title="11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT"><code class="literal">BIGINT</code></a>
            column (eight bytes) can be stored as a
            <a class="link" href="data-types.html#integer-types" title="11.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT"><code class="literal">TINYINT</code></a> column (one byte) if
            all its values are in the range from <code class="literal">-128</code>
            to <code class="literal">127</code>.
          </p></li><li class="listitem"><p>
            <code class="literal">pre-space</code>
          </p><p>
            The number of decimal columns that are stored with leading
            spaces. In this case, each value contains a count for the
            number of leading spaces.
          </p></li><li class="listitem"><p>
            <code class="literal">end-space</code>
          </p><p>
            The number of columns that have a lot of trailing spaces. In
            this case, each value contains a count for the number of
            trailing spaces.
          </p></li><li class="listitem"><p>
            <code class="literal">table-lookup</code>
          </p><p>
            The column had only a small number of different values,
            which were converted to an
            <a class="link" href="data-types.html#enum" title="11.3.5 The ENUM Type"><code class="literal">ENUM</code></a> before Huffman
            compression.
          </p></li><li class="listitem"><p>
            <code class="literal">zero</code>
          </p><p>
            The number of columns for which all values are zero.
          </p></li><li class="listitem"><p>
            <code class="literal">Original trees</code>
          </p><p>
            The initial number of Huffman trees.
          </p></li><li class="listitem"><p>
            <code class="literal">After join</code>
          </p><p>
            The number of distinct Huffman trees left after joining
            trees to save some header space.
</p></li></ul>
</div>
<p>
        After a table has been compressed, the <code class="literal">Field</code>
        lines displayed by <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk -dvv</strong></span></a> include
        additional information about each column:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">Type</code>
          </p><p>
            The data type. The value may contain any of the following
            descriptors:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">constant</code>
              </p><p>
                All rows have the same value.
              </p></li><li class="listitem"><p>
                <code class="literal">no endspace</code>
              </p><p>
                Do not store endspace.
              </p></li><li class="listitem"><p>
                <code class="literal">no endspace, not_always</code>
              </p><p>
                Do not store endspace and do not do endspace compression
                for all values.
              </p></li><li class="listitem"><p>
                <code class="literal">no endspace, no empty</code>
              </p><p>
                Do not store endspace. Do not store empty values.
              </p></li><li class="listitem"><p>
                <code class="literal">table-lookup</code>
              </p><p>
                The column was converted to an
                <a class="link" href="data-types.html#enum" title="11.3.5 The ENUM Type"><code class="literal">ENUM</code></a>.
              </p></li><li class="listitem"><p>
                <code class="literal">zerofill(<em class="replaceable"><code>N</code></em>)</code>
              </p><p>
                The most significant <em class="replaceable"><code>N</code></em> bytes
                in the value are always 0 and are not stored.
              </p></li><li class="listitem"><p>
                <code class="literal">no zeros</code>
              </p><p>
                Do not store zeros.
              </p></li><li class="listitem"><p>
                <code class="literal">always zero</code>
              </p><p>
                Zero values are stored using one bit.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">Huff tree</code>
          </p><p>
            The number of the Huffman tree associated with the column.
          </p></li><li class="listitem"><p>
            <code class="literal">Bits</code>
          </p><p>
            The number of bits used in the Huffman tree.
</p></li></ul>
</div>
<p>
        After you run <a class="link" href="programs.html#myisampack" title="4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables"><span class="command"><strong>myisampack</strong></span></a>, use
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a> to re-create any indexes. At this
        time, you can also sort the index blocks and create statistics
        needed for the MySQL optimizer to work more efficiently:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>myisamchk -rq --sort-index --analyze <em class="replaceable"><code>tbl_name</code></em>.MYI</code></strong>
</pre><p>
        After you have installed the packed table into the MySQL
        database directory, you should execute <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin
        flush-tables</strong></span></a> to force <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to
        start using the new table.
      </p><p>
        To unpack a packed table, use the
        <a class="link" href="programs.html#option_myisamchk_unpack"><code class="option">--unpack</code></a> option to
        <a class="link" href="programs.html#myisamchk" title="4.6.4 myisamchk — MyISAM Table-Maintenance Utility"><span class="command"><strong>myisamchk</strong></span></a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-config-editor"></a>4.6.7 <span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444420114960"></a><a class="indexterm" name="idm46444420114016"></a><a class="indexterm" name="idm46444420113056"></a><p>
        The <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility enables you
        to store authentication credentials in an obfuscated login path
        file named <code class="filename">.mylogin.cnf</code>. The file location
        is the <code class="filename">%APPDATA%\MySQL</code> directory on Windows
        and the current user's home directory on non-Windows systems.
        The file can be read later by MySQL client programs to obtain
        authentication credentials for connecting to MySQL Server.
      </p><p>
        The unobfuscated format of the <code class="filename">.mylogin.cnf</code>
        login path file consists of option groups, similar to other
        option files. Each option group in
        <code class="filename">.mylogin.cnf</code> is called a <span class="quote">“<span class="quote">login
        path,</span>”</span> which is a group that permits only certain
        options: <code class="option">host</code>, <code class="option">user</code>,
        <code class="option">password</code>, <code class="option">port</code> and
        <code class="option">socket</code>. Think of a login path option group as a
        set of options that specify which MySQL server to connect to and
        which account to authenticate as. Here is an unobfuscated
        example:
      </p><pre data-lang="ini" class="programlisting">[client]
user = mydefaultname
password = mydefaultpass
host = 127.0.0.1
[mypath]
user = myothername
password = myotherpass
host = localhost</pre><p>
        When you invoke a client program to connect to the server, the
        client uses <code class="filename">.mylogin.cnf</code> in conjunction
        with other option files. Its precedence is higher than other
        option files, but less than options specified explicitly on the
        client command line. For information about the order in which
        option files are used, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
      </p><a class="indexterm" name="idm46444420100096"></a><a class="indexterm" name="idm46444420098992"></a><p>
        To specify an alternate login path file name, set the
        <code class="literal">MYSQL_TEST_LOGIN_FILE</code> environment variable.
        This variable is recognized by
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a>, by standard MySQL
        clients (<a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>,
        <a class="link" href="programs.html#mysqladmin" title="4.5.2 mysqladmin — Client for Administering a MySQL Server"><span class="command"><strong>mysqladmin</strong></span></a>, and so forth), and by the
        <span class="command"><strong>mysql-test-run.pl</strong></span> testing utility.
      </p><p>
        Programs use groups in the login path file as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> operates on the
            <code class="literal">client</code> login path by default if you
            specify no
            <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
            option to indicate explicitly which login path to use.
          </p></li><li class="listitem"><p>
            Without a <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path</code></a>
            option, client programs read the same option groups from the
            login path file that they read from other option files.
            Consider this command:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql</code></strong>
</pre><p>
            By default, the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client reads the
            <code class="literal">[client]</code> and <code class="literal">[mysql]</code>
            groups from other option files, so it reads them from the
            login path file as well.
          </p></li><li class="listitem"><p>
            With a <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path</code></a> option,
            client programs additionally read the named login path from
            the login path file. The option groups read from other
            option files remain the same. Consider this command:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --login-path=mypath</code></strong>
</pre><p>
            The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client reads
            <code class="literal">[client]</code> and <code class="literal">[mysql]</code>
            from other option files, and <code class="literal">[client]</code>,
            <code class="literal">[mysql]</code>, and <code class="literal">[mypath]</code>
            from the login path file.
          </p></li><li class="listitem"><p>
            Client programs read the login path file even when the
            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a> option is
            used. This permits passwords to be specified in a safer way
            than on the command line even if
            <a class="link" href="programs.html#option_general_no-defaults"><code class="option">--no-defaults</code></a> is present.
</p></li></ul>
</div>
<p>
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> obfuscates the
        <code class="filename">.mylogin.cnf</code> file so it cannot be read as
        cleartext, and its contents when unobfuscated by client programs
        are used only in memory. In this way, passwords can be stored in
        a file in non-cleartext format and used later without ever
        needing to be exposed on the command line or in an environment
        variable. <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> provides a
        <code class="literal">print</code> command for displaying the login path
        file contents, but even in this case, password values are masked
        so as never to appear in a way that other users can see them.
      </p><p>
        The obfuscation used by <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a>
        prevents passwords from appearing in
        <code class="filename">.mylogin.cnf</code> as cleartext and provides a
        measure of security by preventing inadvertent password exposure.
        For example, if you display a regular unobfuscated
        <code class="filename">my.cnf</code> option file on the screen, any
        passwords it contains are visible for anyone to see. With
        <code class="filename">.mylogin.cnf</code>, that is not true. But the
        obfuscation used will not deter a determined attacker and you
        should not consider it unbreakable. A user who can gain system
        administration privileges on your machine to access your files
        could unobfuscate the <code class="filename">.mylogin.cnf</code> file
        with some effort.
      </p><p>
        The login path file must be readable and writable to the current
        user, and inaccessible to other users. Otherwise,
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> ignores it, and client
        programs do not use it, either.
      </p><p>
        Invoke <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor [<em class="replaceable"><code>program_options</code></em>] <em class="replaceable"><code>command</code></em> [<em class="replaceable"><code>command_options</code></em>]</code></strong>
</pre><p>
        If the login path file does not exist,
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> creates it.
      </p><p>
        Command arguments are given as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <em class="replaceable"><code>program_options</code></em> consists of
            general <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> options.
          </p></li><li class="listitem"><p>
            <code class="literal">command</code> indicates what action to perform
            on the <code class="filename">.mylogin.cnf</code> login path file.
            For example, <code class="literal">set</code> writes a login path to
            the file, <code class="literal">remove</code> removes a login path,
            and <code class="literal">print</code> displays login path contents.
          </p></li><li class="listitem"><p>
            <em class="replaceable"><code>command_options</code></em> indicates any
            additional options specific to the command, such as the
            login path name and the values to use in the login path.
</p></li></ul>
</div>
<p>
        The position of the command name within the set of program
        arguments is significant. For example, these command lines have
        the same arguments, but produce different results:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor --help set</code></strong>
shell&gt; <strong class="userinput"><code>mysql_config_editor set --help</code></strong>
</pre><p>
        The first command line displays a general
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> help message, and ignores
        the <code class="literal">set</code> command. The second command line
        displays a help message specific to the <code class="literal">set</code>
        command.
      </p><p>
        Suppose that you want to establish a <code class="literal">client</code>
        login path that defines your default connection parameters, and
        an additional login path named <code class="literal">remote</code> for
        connecting to the MySQL server the host
        <code class="literal">remote.example.com</code>. You want to log in as
        follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            By default, to the local server with a user name and
            password of <code class="literal">localuser</code> and
            <code class="literal">localpass</code>
          </p></li><li class="listitem"><p>
            To the remote server with a user name and password of
            <code class="literal">remoteuser</code> and
            <code class="literal">remotepass</code>
</p></li></ul>
</div>
<p>
        To set up the login paths in the
        <code class="filename">.mylogin.cnf</code> file, use the following
        <code class="literal">set</code> commands. Enter each command on a single
        line, and enter the appropriate passwords when prompted:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor set --login-path=client
         --host=localhost --user=localuser --password</code></strong>
Enter password: <em class="replaceable"><code>enter password "localpass" here</code></em>
shell&gt; <strong class="userinput"><code>mysql_config_editor set --login-path=remote
         --host=remote.example.com --user=remoteuser --password</code></strong>
Enter password: <em class="replaceable"><code>enter password "remotepass" here</code></em>
</pre><p>
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> uses the
        <code class="literal">client</code> login path by default, so the
        <code class="option">--login-path=client</code> option can be omitted from
        the first command without changing its effect.
      </p><p>
        To see what <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> writes to the
        <code class="filename">.mylogin.cnf</code> file, use the
        <code class="literal">print</code> command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor print --all</code></strong>
[client]
user = localuser
password = *****
host = localhost
[remote]
user = remoteuser
password = *****
host = remote.example.com
</pre><p>
        The <code class="literal">print</code> command displays each login path as
        a set of lines beginning with a group header indicating the
        login path name in square brackets, followed by the option
        values for the login path. Password values are masked and do not
        appear as cleartext.
      </p><p>
        If you do not specify <code class="option">--all</code> to display all
        login paths or
        <code class="option">--login-path=<em class="replaceable"><code>name</code></em></code> to
        display a named login path, the <code class="literal">print</code> command
        displays the <code class="literal">client</code> login path by default, if
        there is one.
      </p><p>
        As shown by the preceding example, the login path file can
        contain multiple login paths. In this way,
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> makes it easy to set up
        multiple <span class="quote">“<span class="quote">personalities</span>”</span> for connecting to
        different MySQL servers, or for connecting to a given server
        using different accounts. Any of these can be selected by name
        later using the <code class="option">--login-path</code> option when you
        invoke a client program. For example, to connect to the remote
        server, use this command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --login-path=remote</code></strong>
</pre><p>
        Here, <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> reads the
        <code class="literal">[client]</code> and <code class="literal">[mysql]</code>
        option groups from other option files, and the
        <code class="literal">[client]</code>, <code class="literal">[mysql]</code>, and
        <code class="literal">[remote]</code> groups from the login path file.
      </p><p>
        To connect to the local server, use this command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --login-path=client</code></strong>
</pre><p>
        Because <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> reads the
        <code class="literal">client</code> and <code class="literal">mysql</code> login
        paths by default, the
        <a class="link" href="programs.html#option_general_login-path"><code class="option">--login-path</code></a> option does not add
        anything in this case. That command is equivalent to this one:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql</code></strong>
</pre><p>
        Options read from the login path file take precedence over
        options read from other option files. Options read from login
        path groups appearing later in the login path file take
        precedence over options read from groups appearing earlier in
        the file.
      </p><p>
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> adds login paths to the
        login path file in the order you create them, so you should
        create more general login paths first and more specific paths
        later. If you need to move a login path within the file, you can
        remove it, then recreate it to add it to the end. For example, a
        <code class="literal">client</code> login path is more general because it
        is read by all client programs, whereas a
        <code class="literal">mysqldump</code> login path is read only by
        <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>. Options specified later override
        options specified earlier, so putting the login paths in the
        order <code class="literal">client</code>, <code class="literal">mysqldump</code>
        enables <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a>-specific options to
        override <code class="literal">client</code> options.
      </p><p>
        When you use the <code class="literal">set</code> command with
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> to create a login path,
        you need not specify all possible option values (host name, user
        name, password, port, socket). Only those values given are
        written to the path. Any missing values required later can be
        specified when you invoke a client path to connect to the MySQL
        server, either in other option files or on the command line. Any
        options specified on the command line override those specified
        in the login path file or other option files. For example, if
        the credentials in the <code class="literal">remote</code> login path also
        apply for the host <code class="literal">remote2.example.com</code>,
        connect to the server on that host like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql --login-path=remote --host=remote2.example.com</code></strong>
</pre>
<h4><a name="mysql-config-editor-command-options"></a>mysql_config_editor General Options</h4>
<p>
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> supports the following
        general options, which may be used preceding any command named
        on the command line. For descriptions of command-specific
        options, see <a class="xref" href="programs.html#mysql-config-editor-commands" title="mysql_config_editor Commands and Command-Specific Options">mysql_config_editor Commands and Command-Specific Options</a>.
</p>
<div class="table">
<a name="idm46444419972512"></a><p class="title"><b>Table 4.20 mysql_config_editor General Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="General Command-line options available for mysql_config_editor."><col width="35%"><col width="64%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysql_config_editor_debug">--debug</a></td>
<td>Write debugging log</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_config_editor_help">--help</a></td>
<td>Display help message and exit</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_config_editor_verbose">--verbose</a></td>
<td>Verbose mode</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysql_config_editor_version">--version</a></td>
<td>Display version information and exit</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_config_editor_help"></a>
            <a class="indexterm" name="idm46444419952688"></a>

            <a class="indexterm" name="idm46444419951200"></a>

            <a class="link" href="programs.html#option_mysql_config_editor_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a general help message and exit.
          </p><p>
            To see a command-specific help message, invoke
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> as follows, where
            <em class="replaceable"><code>command</code></em> is a command other than
            <code class="literal">help</code>:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor <em class="replaceable"><code>command</code></em> --help</code></strong>
</pre></li><li class="listitem"><p><a name="option_mysql_config_editor_debug"></a>
            <a class="indexterm" name="idm46444419941696"></a>

            <a class="indexterm" name="idm46444419940208"></a>

            <a class="link" href="programs.html#option_mysql_config_editor_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-# <em class="replaceable"><code>debug_options</code></em></code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:o,/tmp/mysql_config_editor.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysql_config_editor_verbose"></a>
            <a class="indexterm" name="idm46444419930784"></a>

            <a class="indexterm" name="idm46444419929296"></a>

            <a class="link" href="programs.html#option_mysql_config_editor_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does. This option may be helpful in diagnosing problems if
            an operation does not have the effect you expect.
          </p></li><li class="listitem"><p><a name="option_mysql_config_editor_version"></a>
            <a class="indexterm" name="idm46444419924576"></a>

            <a class="indexterm" name="idm46444419923088"></a>

            <a class="link" href="programs.html#option_mysql_config_editor_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>
<h4><a name="mysql-config-editor-commands"></a>mysql_config_editor Commands and Command-Specific Options</h4>
<p>
        This section describes the permitted
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> commands, and, for each
        one, the command-specific options permitted following the
        command name on the command line.
      </p><p>
        In addition, <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> supports
        general options that can be used preceding any command. For
        descriptions of these options, see
        <a class="xref" href="programs.html#mysql-config-editor-command-options" title="mysql_config_editor General Options">mysql_config_editor General Options</a>.
      </p><p>
        <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> supports these commands:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">help</code>
          </p><p>
            Display a general help message and exit. This command takes
            no following options.
          </p><p>
            To see a command-specific help message, invoke
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> as follows, where
            <em class="replaceable"><code>command</code></em> is a command other than
            <code class="literal">help</code>:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor <em class="replaceable"><code>command</code></em> --help</code></strong>
</pre></li><li class="listitem"><p>
            <code class="literal">print
            [<em class="replaceable"><code>options</code></em>]</code>
          </p><p>
            Print the contents of the login path file in unobfuscated
            form, with the exception that passwords are displayed as
            <code class="literal">*****</code>.
          </p><p>
            The default login path name is <code class="literal">client</code> if
            no login path is named. If both <code class="option">--all</code> and
            <code class="option">--login-path</code> are given,
            <code class="option">--all</code> takes precedence.
          </p><p>
            The <code class="literal">print</code> command permits these options
            following the command name:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="option">--help</code>, <code class="option">-?</code>
              </p><p>
                Display a help message for the <code class="literal">print</code>
                command and exit.
              </p><p>
                To see a general help message, use
                <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor --help</strong></span></a>.
              </p></li><li class="listitem"><p>
                <code class="option">--all</code>
              </p><p>
                Print the contents of all login paths in the login path
                file.
              </p></li><li class="listitem"><p>
                <code class="option">--login-path=<em class="replaceable"><code>name</code></em></code>,
                <code class="option">-G <em class="replaceable"><code>name</code></em></code>
              </p><p>
                Print the contents of the named login path.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">remove
            [<em class="replaceable"><code>options</code></em>]</code>
          </p><p>
            Remove a login path from the login path file, or modify a
            login path by removing options from it.
          </p><p>
            This command removes from the login path only such options
            as are specified with the <code class="option">--host</code>,
            <code class="option">--password</code>, <code class="option">--port</code>,
            <code class="option">--socket</code>, and <code class="option">--user</code>
            options. If none of those options are given,
            <code class="literal">remove</code> removes the entire login path. For
            example, this command removes only the <code class="option">user</code>
            option from the <code class="literal">mypath</code> login path rather
            than the entire <code class="literal">mypath</code> login path:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor remove --login-path=mypath --user</code></strong>
</pre><p>
            This command removes the entire <code class="literal">mypath</code>
            login path:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config_editor remove --login-path=mypath</code></strong>
</pre><p>
            The <code class="literal">remove</code> command permits these options
            following the command name:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="option">--help</code>, <code class="option">-?</code>
              </p><p>
                Display a help message for the <code class="literal">remove</code>
                command and exit.
              </p><p>
                To see a general help message, use
                <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor --help</strong></span></a>.
              </p></li><li class="listitem"><p>
                <code class="option">--host</code>, <code class="option">-h</code>
              </p><p>
                Remove the host name from the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--login-path=<em class="replaceable"><code>name</code></em></code>,
                <code class="option">-G <em class="replaceable"><code>name</code></em></code>
              </p><p>
                The login path to remove or modify. The default login
                path name is <code class="literal">client</code> if this option is
                not given.
              </p></li><li class="listitem"><p>
                <code class="option">--password</code>, <code class="option">-p</code>
              </p><p>
                Remove the password from the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--port</code>, <code class="option">-P</code>
              </p><p>
                Remove the TCP/IP port number from the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--socket</code>, <code class="option">-S</code>
              </p><p>
                Remove the Unix socket file name from the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--user</code>, <code class="option">-u</code>
              </p><p>
                Remove the user name from the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--warn</code>, <code class="option">-w</code>
              </p><p>
                Warn and prompt the user for confirmation if the command
                attempts to remove the default login path
                (<code class="literal">client</code>) and
                <code class="option">--login-path=client</code> was not specified.
                This option is enabled by default; use
                <code class="option">--skip-warn</code> to disable it.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">reset
            [<em class="replaceable"><code>options</code></em>]</code>
          </p><p>
            Empty the contents of the login path file.
          </p><p>
            The <code class="literal">reset</code> command permits these options
            following the command name:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="option">--help</code>, <code class="option">-?</code>
              </p><p>
                Display a help message for the <code class="literal">reset</code>
                command and exit.
              </p><p>
                To see a general help message, use
                <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor --help</strong></span></a>.
</p></li></ul>
</div>
</li><li class="listitem"><p>
            <code class="literal">set [<em class="replaceable"><code>options</code></em>]</code>
          </p><p>
            Write a login path to the login path file.
          </p><p>
            This command writes to the login path only such options as
            are specified with the <code class="option">--host</code>,
            <code class="option">--password</code>, <code class="option">--port</code>,
            <code class="option">--socket</code>, and <code class="option">--user</code>
            options. If none of those options are given,
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> writes the login path
            as an empty group.
          </p><p>
            The <code class="literal">set</code> command permits these options
            following the command name:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="option">--help</code>, <code class="option">-?</code>
              </p><p>
                Display a help message for the <code class="literal">set</code>
                command and exit.
              </p><p>
                To see a general help message, use
                <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor --help</strong></span></a>.
              </p></li><li class="listitem"><p>
                <code class="option">--host=<em class="replaceable"><code>host_name</code></em></code>,
                <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
              </p><p>
                The host name to write to the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--login-path=<em class="replaceable"><code>name</code></em></code>,
                <code class="option">-G <em class="replaceable"><code>name</code></em></code>
              </p><p>
                The login path to create. The default login path name is
                <code class="literal">client</code> if this option is not given.
              </p></li><li class="listitem"><p>
                <code class="option">--password</code>, <code class="option">-p</code>
              </p><p>
                Prompt for a password to write to the login path. After
                <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> displays the
                prompt, type the password and press Enter. To prevent
                other users from seeing the password,
                <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> does not echo it.
              </p><p>
                To specify an empty password, press Enter at the
                password prompt. The resulting login path written to the
                login path file will include a line like this:
              </p><pre data-lang="ini" class="programlisting">password =</pre></li><li class="listitem"><p>
                <code class="option">--port=<em class="replaceable"><code>port_num</code></em></code>,
                <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
              </p><p>
                The TCP/IP port number to write to the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--socket=<em class="replaceable"><code>file_name</code></em></code>,
                <code class="option">-S <em class="replaceable"><code>file_name</code></em></code>
              </p><p>
                The Unix socket file name to write to the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--user=<em class="replaceable"><code>user_name</code></em></code>,
                <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
              </p><p>
                The user name to write to the login path.
              </p></li><li class="listitem"><p>
                <code class="option">--warn</code>, <code class="option">-w</code>
              </p><p>
                Warn and prompt the user for confirmation if the command
                attempts to overwrite an existing login path. This
                option is enabled by default; use
                <code class="option">--skip-warn</code> to disable it.
</p></li></ul>
</div>
</li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqlbinlog"></a>4.6.8 <span class="command"><strong>mysqlbinlog</strong></span> — Utility for Processing Binary Log Files</h3>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#mysqlbinlog-hexdump">4.6.8.1 mysqlbinlog Hex Dump Format</a></span></dt><dt><span class="section"><a href="programs.html#mysqlbinlog-row-events">4.6.8.2 mysqlbinlog Row Event Display</a></span></dt><dt><span class="section"><a href="programs.html#mysqlbinlog-backup">4.6.8.3 Using mysqlbinlog to Back Up Binary Log Files</a></span></dt><dt><span class="section"><a href="programs.html#mysqlbinlog-server-id">4.6.8.4 Specifying the mysqlbinlog Server ID</a></span></dt></dl>
</div>
<a class="indexterm" name="idm46444419807312"></a><p>
        The server's binary log consists of files containing
        <span class="quote">“<span class="quote">events</span>”</span> that describe modifications to database
        contents. The server writes these files in binary format. To
        display their contents in text format, use the
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> utility. You can also use
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to display the contents of relay
        log files written by a slave server in a replication setup
        because relay logs have the same format as binary logs. The
        binary log and relay log are discussed further in
        <a class="xref" href="server-administration.html#binary-log" title="5.4.4 The Binary Log">Section 5.4.4, “The Binary Log”</a>, and <a class="xref" href="replication.html#slave-logs" title="17.2.4 Replication Relay and Status Logs">Section 17.2.4, “Replication Relay and Status Logs”</a>.
      </p><p>
        Invoke <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>log_file</code></em> ...</code></strong>
</pre><p>
        For example, to display the contents of the binary log file
        named <code class="filename">binlog.000003</code>, use this command:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.0000003</code></strong>
</pre><p>
        The output includes events contained in
        <code class="filename">binlog.000003</code>. For statement-based logging,
        event information includes the SQL statement, the ID of the
        server on which it was executed, the timestamp when the
        statement was executed, how much time it took, and so forth. For
        row-based logging, the event indicates a row change rather than
        an SQL statement. See <a class="xref" href="replication.html#replication-formats" title="17.2.1 Replication Formats">Section 17.2.1, “Replication Formats”</a>, for
        information about logging modes.
      </p><p>
        Events are preceded by header comments that provide additional
        information. For example:
      </p><pre data-lang="none" class="programlisting"># at 141
#100309  9:28:36 server id 123  end_log_pos 245
  Query thread_id=3350  exec_time=11  error_code=0</pre><p>
        In the first line, the number following <code class="literal">at</code>
        indicates the file offset, or starting position, of the event in
        the binary log file.
      </p><p>
        The second line starts with a date and time indicating when the
        statement started on the server where the event originated. For
        replication, this timestamp is propagated to slave servers.
        <code class="literal">server id</code> is the
        <a class="link" href="replication.html#sysvar_server_id"><code class="literal">server_id</code></a> value of the server
        where the event originated. <code class="literal">end_log_pos</code>
        indicates where the next event starts (that is, it is the end
        position of the current event + 1). <code class="literal">thread_id</code>
        indicates which thread executed the event.
        <code class="literal">exec_time</code> is the time spent executing the
        event, on a master server. On a slave, it is the difference of
        the end execution time on the slave minus the beginning
        execution time on the master. The difference serves as an
        indicator of how much replication lags behind the master.
        <code class="literal">error_code</code> indicates the result from
        executing the event. Zero means that no error occurred.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          When using event groups, the file offsets of events may be
          grouped together and the comments of events may be grouped
          together. Do not mistake these grouped events for blank file
          offsets.
</p>
</div>
<p>
        The output from <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> can be
        re-executed (for example, by using it as input to
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>) to redo the statements in the log.
        This is useful for recovery operations after a server crash. For
        other usage examples, see the discussion later in this section
        and in <a class="xref" href="backup-and-recovery.html#point-in-time-recovery" title="7.5 Point-in-Time (Incremental) Recovery Using the Binary Log">Section 7.5, “Point-in-Time (Incremental) Recovery Using the Binary Log”</a>. To execute the
        internal-use <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements
        used by <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>, the user requires the
        <a class="link" href="security.html#priv_binlog-admin"><code class="literal">BINLOG_ADMIN</code></a> privilege (or the
        deprecated <a class="link" href="security.html#priv_super"><code class="literal">SUPER</code></a> privilege), or
        the <a class="link" href="security.html#priv_replication-applier"><code class="literal">REPLICATION_APPLIER</code></a> privilege
        plus the appropriate privileges to execute each log event.
      </p><p>
        You can use <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to read binary log
        files directly and apply them to the local MySQL server. You can
        also read binary logs from a remote server by using the
        <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
        option. To read remote binary logs, the connection parameter
        options can be given to indicate how to connect to the server.
        These options are <a class="link" href="programs.html#option_mysqlbinlog_host"><code class="option">--host</code></a>,
        <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--password</code></a>,
        <a class="link" href="programs.html#option_mysqlbinlog_port"><code class="option">--port</code></a>,
        <a class="link" href="programs.html#option_mysqlbinlog_protocol"><code class="option">--protocol</code></a>,
        <a class="link" href="programs.html#option_mysqlbinlog_socket"><code class="option">--socket</code></a>, and
        <a class="link" href="programs.html#option_mysqlbinlog_user"><code class="option">--user</code></a>.
      </p><p>
        When binary log files have been encrypted, which can be done
        from MySQL 8.0.14 onwards, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> cannot
        read them directly, but can read them from the server using the
        <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
        option. Binary log files are encrypted when the server's
        <a class="link" href="replication.html#sysvar_binlog_encryption"><code class="literal">binlog_encryption</code></a> system
        variable is set to <code class="literal">ON</code>. The
        <a class="link" href="sql-statements.html#show-binary-logs" title="13.7.7.1 SHOW BINARY LOGS Statement"><code class="literal">SHOW BINARY LOGS</code></a> statement shows
        whether a particular binary log file is encrypted or
        unencrypted. Encrypted and unencrypted binary log files can also
        be distinguished using the magic number at the start of the file
        header for encrypted log files (<code class="literal">0xFD62696E</code>),
        which differs from that used for unencrypted log files
        (<code class="literal">0xFE62696E</code>). Note that from MySQL 8.0.14,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> returns a suitable error if you
        attempt to read an encrypted binary log file directly, but older
        versions of <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> do not recognise the
        file as a binary log file at all. For more information on binary
        log encryption, see
        <a class="xref" href="replication.html#replication-binlog-encryption" title="17.3.2 Encrypting Binary Log Files and Relay Log Files">Section 17.3.2, “Encrypting Binary Log Files and Relay Log Files”</a>.
      </p><p>
        When binary log transaction payloads have been compressed, which
        can be done from MySQL 8.0.20 onwards,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> versions from that release on
        automatically decompress and decode the transaction payloads,
        and print them as they would uncompressed events. Older versions
        of <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> cannot read compressed
        transaction payloads. When the server's
        <a class="link" href="replication.html#sysvar_binlog_transaction_compression"><code class="literal">binlog_transaction_compression</code></a>
        system variable is set to <code class="literal">ON</code>, transaction
        payloads are compressed and then written to the server's binary
        log file as a single event (a
        <code class="literal">Transaction_payload_event</code>). With the
        <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> option,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> adds comments stating the
        compression algorithm used, the compressed payload size that was
        originally received, and the resulting payload size after
        decompression.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          The end position (<code class="literal">end_log_pos</code>) that
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> states for an individual event
          that was part of a compressed transaction payload is the same
          as the end position of the original compressed payload.
          Multiple decompressed events can therefore have the same end
          position.
        </p><p>
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>'s own connection compression
          does less if transaction payloads are already compressed, but
          still operates on uncompressed transactions and headers.
</p>
</div>
<p>
        For more information on binary log transaction compression, see
        <a class="xref" href="server-administration.html#binary-log-transaction-compression" title="5.4.4.5 Binary Log Transaction Compression">Section 5.4.4.5, “Binary Log Transaction Compression”</a>.
      </p><p>
        When running <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> against a large
        binary log, be careful that the filesystem has enough space for
        the resulting files. To configure the directory that
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> uses for temporary files, use the
        <code class="literal">TMPDIR</code> environment variable.
      </p><p>
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> sets the value of
        <a class="link" href="server-administration.html#sysvar_pseudo_slave_mode"><code class="literal">pseudo_slave_mode</code></a> to true
        before executing any SQL statements. This system variable
        affects the handling of XA transactions, the
        <code class="literal">original_commit_timestamp</code> replication delay
        timestamp and the
        <a class="link" href="replication.html#sysvar_original_server_version"><code class="literal">original_server_version</code></a> system
        variable, and unsupported SQL modes.
      </p><p>
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> supports the following options,
        which can be specified on the command line or in the
        <code class="literal">[mysqlbinlog]</code> and <code class="literal">[client]</code>
        groups of an option file. For information about option files
        used by MySQL programs, see <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p>
<div class="table">
<a name="idm46444419721872"></a><p class="title"><b>Table 4.21 mysqlbinlog Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqlbinlog."><col width="27%"><col width="50%"><col width="11%"><col width="11%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
<th scope="col">Introduced</th>
<th scope="col">Deprecated</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_base64-output">--base64-output</a></td>
<td>Print binary log entries using base-64 encoding</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_bind-address">--bind-address</a></td>
<td>Use specified network interface to connect to MySQL Server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_binlog-row-event-max-size">--binlog-row-event-max-size</a></td>
<td>Binary log max event size</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_character-sets-dir">--character-sets-dir</a></td>
<td>Directory where character sets are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_compress">--compress</a></td>
<td>Compress all information sent between client and server</td>
<td>8.0.17</td>
<td>8.0.18</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_compression-algorithms">--compression-algorithms</a></td>
<td>Permitted compression algorithms for connections to server</td>
<td>8.0.18</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_connection-server-id">--connection-server-id</a></td>
<td>Used for testing and debugging. See text for applicable default values and other particulars</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_database">--database</a></td>
<td>List entries for just this database</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_debug">--debug</a></td>
<td>Write debugging log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_debug-check">--debug-check</a></td>
<td>Print debugging information when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_debug-info">--debug-info</a></td>
<td>Print debugging information, memory, and CPU statistics when program exits</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_default-auth">--default-auth</a></td>
<td>Authentication plugin to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_defaults-extra-file">--defaults-extra-file</a></td>
<td>Read named option file in addition to usual option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_defaults-file">--defaults-file</a></td>
<td>Read only named option file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_defaults-group-suffix">--defaults-group-suffix</a></td>
<td>Option group suffix value</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_disable-log-bin">--disable-log-bin</a></td>
<td>Disable binary logging</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_exclude-gtids">--exclude-gtids</a></td>
<td>Do not show any of the groups in the GTID set provided</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_force-if-open">--force-if-open</a></td>
<td>Read binary log files even if open or not closed properly</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_force-read">--force-read</a></td>
<td>If mysqlbinlog reads a binary log event that it does not recognize, it prints a warning</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_get-server-public-key">--get-server-public-key</a></td>
<td>Request RSA public key from server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_help">--help</a></td>
<td>Display help message and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_hexdump">--hexdump</a></td>
<td>Display a hex dump of the log in comments</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_host">--host</a></td>
<td>Host on which MySQL server is located</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_idempotent">--idempotent</a></td>
<td>Cause the server to use idempotent mode while processing binary log updates from this session only</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_include-gtids">--include-gtids</a></td>
<td>Show only the groups in the GTID set provided</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_local-load">--local-load</a></td>
<td>Prepare local temporary files for LOAD DATA in the specified directory</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_login-path">--login-path</a></td>
<td>Read login path options from .mylogin.cnf</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_no-defaults">--no-defaults</a></td>
<td>Read no option files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_offset">--offset</a></td>
<td>Skip the first N entries in the log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_password">--password</a></td>
<td>Password to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_plugin-dir">--plugin-dir</a></td>
<td>Directory where plugins are installed</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_port">--port</a></td>
<td>TCP/IP port number for connection</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_print-defaults">--print-defaults</a></td>
<td>Print default options</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_print-table-metadata">--print-table-metadata</a></td>
<td>Print table metadata</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_protocol">--protocol</a></td>
<td>Connection protocol to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_raw">--raw</a></td>
<td>Write events in raw (binary) format to output files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-master">--read-from-remote-master</a></td>
<td>Read the binary log from a MySQL master rather than reading a local log file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server">--read-from-remote-server</a></td>
<td>Read binary log from MySQL server rather than local log file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_require-row-format">--require-row-format</a></td>
<td>Require row-based binary logging format</td>
<td>8.0.19</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_result-file">--result-file</a></td>
<td>Direct output to named file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_rewrite-db">--rewrite-db</a></td>
<td>Create rewrite rules for databases when playing back from logs written in row-based format. Can be used multiple times</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_server-id">--server-id</a></td>
<td>Extract only those events created by the server having the given server ID</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_server-id-bits">--server-id-bits</a></td>
<td>Tell mysqlbinlog how to interpret server IDs in binary log when log was written by a mysqld having its server-id-bits set to less than the maximum; supported only by MySQL Cluster version of mysqlbinlog</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_server-public-key-path">--server-public-key-path</a></td>
<td>Path name to file containing RSA public key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_set-charset">--set-charset</a></td>
<td>Add a SET NAMES charset_name statement to the output</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_shared-memory-base-name">--shared-memory-base-name</a></td>
<td>Name of shared memory to use for shared-memory connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_short-form">--short-form</a></td>
<td>Display only the statements contained in the log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_skip-gtids">--skip-gtids</a></td>
<td>Do not print any GTIDs; use this when writing a dump file from binary logs containing GTIDs</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_socket">--socket</a></td>
<td>Unix socket file or Windows named pipe to use</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-ca</a></td>
<td>File that contains list of trusted SSL Certificate Authorities</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-capath</a></td>
<td>Directory that contains trusted SSL Certificate Authority certificate files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-cert</a></td>
<td>File that contains X.509 certificate</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-cipher</a></td>
<td>Permissible ciphers for connection encryption</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-crl</a></td>
<td>File that contains certificate revocation lists</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-crlpath</a></td>
<td>Directory that contains certificate revocation-list files</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl-fips-mode">--ssl-fips-mode</a></td>
<td>Whether to enable FIPS mode on client side</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-key</a></td>
<td>File that contains X.509 key</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_ssl">--ssl-mode</a></td>
<td>Desired security state of connection to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_start-datetime">--start-datetime</a></td>
<td>Read binary log from first event with timestamp equal to or later than datetime argument</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_start-position">--start-position</a></td>
<td>Read binary log from first event with position equal to or greater than argument</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_stop-datetime">--stop-datetime</a></td>
<td>Stop reading binary log at first event with timestamp equal to or greater than datetime argument</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_stop-never">--stop-never</a></td>
<td>Stay connected to server after reading last binary log file</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_stop-never-slave-server-id">--stop-never-slave-server-id</a></td>
<td>Slave server ID to report when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_stop-position">--stop-position</a></td>
<td>Stop reading binary log at first event with position equal to or greater than argument</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_tls-ciphersuites">--tls-ciphersuites</a></td>
<td>Permissible TLSv1.3 ciphersuites for encrypted connections</td>
<td>8.0.16</td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_tls-version">--tls-version</a></td>
<td>Permissible TLS protocols for encrypted connections</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_to-last-log">--to-last-log</a></td>
<td>Do not stop at the end of requested binary log from a MySQL server, but rather continue printing to end of last binary log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_user">--user</a></td>
<td>MySQL user name to use when connecting to server</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_verbose">--verbose</a></td>
<td>Reconstruct row events as SQL statements</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_verify-binlog-checksum">--verify-binlog-checksum</a></td>
<td>Verify checksums in binary log</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_version">--version</a></td>
<td>Display version information and exit</td>
<td></td>
<td></td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_zstd-compression-level">--zstd-compression-level</a></td>
<td>Compression level for connections to server that use zstd compression</td>
<td>8.0.18</td>
<td></td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqlbinlog_help"></a>
            <a class="indexterm" name="idm46444419388608"></a>

            <a class="indexterm" name="idm46444419387152"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_base64-output"></a>
            <a class="indexterm" name="idm46444419382576"></a>

            <a class="indexterm" name="idm46444419381088"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=<em class="replaceable"><code>value</code></em></code></a>
          </p><p>
            This option determines when events should be displayed
            encoded as base-64 strings using
            <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements. The option
            has these permissible values (not case-sensitive):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">AUTO</code> ("automatic") or
                <code class="literal">UNSPEC</code> ("unspecified") displays
                <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements
                automatically when necessary (that is, for format
                description events and row events). If no
                <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output</code></a>
                option is given, the effect is the same as
                <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=AUTO</code></a>.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
                  Automatic <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a>
                  display is the only safe behavior if you intend to use
                  the output of <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to
                  re-execute binary log file contents. The other option
                  values are intended only for debugging or testing
                  purposes because they may produce output that does not
                  include all events in executable form.
</p>
</div>
</li><li class="listitem"><p>
                <code class="literal">NEVER</code> causes
                <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements not to
                be displayed. <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> exits with
                an error if a row event is found that must be displayed
                using <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a>.
              </p></li><li class="listitem"><p>
                <code class="literal">DECODE-ROWS</code> specifies to
                <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> that you intend for row
                events to be decoded and displayed as commented SQL
                statements by also specifying the
                <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> option.
                Like <code class="literal">NEVER</code>,
                <code class="literal">DECODE-ROWS</code> suppresses display of
                <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements, but
                unlike <code class="literal">NEVER</code>, it does not exit with
                an error if a row event is found.
</p></li></ul>
</div>
<p>
            For examples that show the effect of
            <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output</code></a> and
            <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> on row event
            output, see <a class="xref" href="programs.html#mysqlbinlog-row-events" title="4.6.8.2 mysqlbinlog Row Event Display">Section 4.6.8.2, “mysqlbinlog Row Event Display”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_bind-address"></a>
            <a class="indexterm" name="idm46444419349584"></a>

            <a class="indexterm" name="idm46444419348096"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_bind-address"><code class="option">--bind-address=<em class="replaceable"><code>ip_address</code></em></code></a>
          </p><p>
            On a computer having multiple network interfaces, use this
            option to select which interface to use for connecting to
            the MySQL server.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_binlog-row-event-max-size"></a>
            <a class="indexterm" name="idm46444419343456"></a>

            <a class="indexterm" name="idm46444419342000"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_binlog-row-event-max-size"><code class="option">--binlog-row-event-max-size=<em class="replaceable"><code>N</code></em></code></a>
</p>
<div class="informaltable">
<table frame="box" rules="all" summary="Properties for binlog-row-event-max-size"><col width="30%"><col width="70%"><thead><tr><th scope="col">Property</th>
<th scope="col">Value</th>
</tr></thead><tbody><tr><td scope="row"><span class="bold"><strong>Command-Line Format</strong></span></td>
<td><code class="literal">--binlog-row-event-max-size=#</code></td>
</tr><tr><td scope="row"><span class="bold"><strong>Type</strong></span></td>
<td>Numeric</td>
</tr><tr><td scope="row"><span class="bold"><strong>Default Value</strong></span></td>
<td><code class="literal">4294967040</code></td>
</tr><tr><td scope="row"><span class="bold"><strong>Minimum Value</strong></span></td>
<td><code class="literal">256</code></td>
</tr><tr><td scope="row"><span class="bold"><strong>Maximum Value</strong></span></td>
<td><code class="literal">18446744073709547520</code></td>
</tr></tbody></table>
</div>
<p>
            Specify the maximum size of a row-based binary log event, in
            bytes. Rows are grouped into events smaller than this size
            if possible. The value should be a multiple of 256. The
            default is 4GB.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_character-sets-dir"></a>
            <a class="indexterm" name="idm46444419316368"></a>

            <a class="indexterm" name="idm46444419314912"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_character-sets-dir"><code class="option">--character-sets-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory where character sets are installed. See
            <a class="xref" href="charset.html#charset-configuration" title="10.15 Character Set Configuration">Section 10.15, “Character Set Configuration”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_compress"></a>
            <a class="indexterm" name="idm46444419309728"></a>

            <a class="indexterm" name="idm46444419308240"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_compress"><code class="option">--compress</code></a>
          </p><p>
            Compress all information sent between the client and the
            server if possible. See
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.17. As of MySQL 8.0.18 it
            is deprecated. It will be removed in a future MySQL version.
            See
            <a class="xref" href="programs.html#connection-compression-legacy-configuration" title="Legacy Connection Compression Configuration">Legacy Connection Compression Configuration</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_compression-algorithms"></a>
            <a class="link" href="programs.html#option_mysqlbinlog_compression-algorithms"><code class="option">--compression-algorithms=<em class="replaceable"><code>value</code></em></code></a>
          </p><a class="indexterm" name="idm46444419300560"></a><a class="indexterm" name="idm46444419299056"></a><p>
            The permitted compression algorithms for connections to the
            server. The available algorithms are the same as for the
            <a class="link" href="server-administration.html#sysvar_protocol_compression_algorithms"><code class="literal">protocol_compression_algorithms</code></a>
            system variable. The default value is
            <code class="literal">uncompressed</code>.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_connection-server-id"></a>
            <a class="indexterm" name="idm46444419292304"></a>

            <a class="indexterm" name="idm46444419290848"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id=<em class="replaceable"><code>server_id</code></em></code></a>
          </p><p>
            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id</code></a>
            specifies the server ID that <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>
            reports when it connects to the server. It can be used to
            avoid a conflict with the ID of a slave server or another
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> process.
          </p><p>
            If the
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
            option is specified, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reports
            a server ID of 0, which tells the server to disconnect after
            sending the last log file (nonblocking behavior). If the
            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a> option is
            also specified to maintain the connection to the server,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reports a server ID of 1 by
            default instead of 0, and
            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id</code></a>
            can be used to replace that server ID if required. See
            <a class="xref" href="programs.html#mysqlbinlog-server-id" title="4.6.8.4 Specifying the mysqlbinlog Server ID">Section 4.6.8.4, “Specifying the mysqlbinlog Server ID”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_database"></a>
            <a class="indexterm" name="idm46444419275728"></a>

            <a class="indexterm" name="idm46444419274240"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_database"><code class="option">--database=<em class="replaceable"><code>db_name</code></em></code></a>,
            <code class="option">-d <em class="replaceable"><code>db_name</code></em></code>
          </p><p>
            This option causes <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to output
            entries from the binary log (local log only) that occur
            while <em class="replaceable"><code>db_name</code></em> is been selected as
            the default database by <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a>.
          </p><p>
            The <a class="link" href="programs.html#option_mysqlbinlog_database"><code class="option">--database</code></a> option
            for <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> is similar to the
            <a class="link" href="replication.html#option_mysqld_binlog-do-db"><code class="option">--binlog-do-db</code></a> option for
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>, but can be used to specify only
            one database. If
            <a class="link" href="programs.html#option_mysqlbinlog_database"><code class="option">--database</code></a> is given
            multiple times, only the last instance is used.
          </p><p>
            The effects of this option depend on whether the
            statement-based or row-based logging format is in use, in
            the same way that the effects of
            <a class="link" href="replication.html#option_mysqld_binlog-do-db"><code class="option">--binlog-do-db</code></a> depend on
            whether statement-based or row-based logging is in use.
          </p><p><b>Statement-based logging. </b>
              The <a class="link" href="programs.html#option_mysqlbinlog_database"><code class="option">--database</code></a> option
              works as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                While <em class="replaceable"><code>db_name</code></em> is the default
                database, statements are output whether they modify
                tables in <em class="replaceable"><code>db_name</code></em> or a
                different database.
              </p></li><li class="listitem"><p>
                Unless <em class="replaceable"><code>db_name</code></em> is selected as
                the default database, statements are not output, even if
                they modify tables in
                <em class="replaceable"><code>db_name</code></em>.
              </p></li><li class="listitem"><p>
                There is an exception for <a class="link" href="sql-statements.html#create-database" title="13.1.12 CREATE DATABASE Statement"><code class="literal">CREATE
                DATABASE</code></a>, <a class="link" href="sql-statements.html#alter-database" title="13.1.2 ALTER DATABASE Statement"><code class="literal">ALTER
                DATABASE</code></a>, and <a class="link" href="sql-statements.html#drop-database" title="13.1.24 DROP DATABASE Statement"><code class="literal">DROP
                DATABASE</code></a>. The database being
                <span class="emphasis"><em>created, altered, or dropped</em></span> is
                considered to be the default database when determining
                whether to output the statement.
</p></li></ul>
</div>
<p>
            Suppose that the binary log was created by executing these
            statements using statement-based-logging:
          </p><pre data-lang="sql" class="programlisting">INSERT INTO test.t1 (i) VALUES(100);
INSERT INTO db2.t2 (j)  VALUES(200);
USE test;
INSERT INTO test.t1 (i) VALUES(101);
INSERT INTO t1 (i)      VALUES(102);
INSERT INTO db2.t2 (j)  VALUES(201);
USE db2;
INSERT INTO test.t1 (i) VALUES(103);
INSERT INTO db2.t2 (j)  VALUES(202);
INSERT INTO t2 (j)      VALUES(203);</pre><p>
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog --database=test</strong></span></a> does not
            output the first two <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements because there is no default database. It outputs
            the three <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements
            following <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE
            test</code></a>, but not the three
            <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a> statements following
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE db2</code></a>.
          </p><p>
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog --database=db2</strong></span></a> does not
            output the first two <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements because there is no default database. It does not
            output the three <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements following
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE test</code></a>, but
            does output the three <a class="link" href="sql-statements.html#insert" title="13.2.6 INSERT Statement"><code class="literal">INSERT</code></a>
            statements following
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE db2</code></a>.
          </p><p><b>Row-based logging. </b>
              <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> outputs only entries that
              change tables belonging to
              <em class="replaceable"><code>db_name</code></em>. The default database
              has no effect on this. Suppose that the binary log just
              described was created using row-based logging rather than
              statement-based logging. <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog
              --database=test</strong></span></a> outputs only those entries that
              modify <code class="literal">t1</code> in the test database,
              regardless of whether <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a>
              was issued or what the default database is.
            </p><p>
            If a server is running with
            <a class="link" href="replication.html#sysvar_binlog_format"><code class="literal">binlog_format</code></a> set to
            <code class="literal">MIXED</code> and you want it to be possible to
            use <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> with the
            <a class="link" href="programs.html#option_mysqlbinlog_database"><code class="option">--database</code></a> option, you
            must ensure that tables that are modified are in the
            database selected by <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a>. (In
            particular, no cross-database updates should be used.)
          </p><p>
            When used together with the
            <a class="link" href="programs.html#option_mysqlbinlog_rewrite-db"><code class="option">--rewrite-db</code></a> option, the
            <code class="option">--rewrite-db</code> option is applied first; then
            the <code class="option">--database</code> option is applied, using the
            rewritten database name. The order in which the options are
            provided makes no difference in this regard.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_debug"></a>
            <a class="indexterm" name="idm46444419214176"></a>

            <a class="indexterm" name="idm46444419212688"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_debug"><code class="option">--debug[=<em class="replaceable"><code>debug_options</code></em>]</code></a>,
            <code class="option">-#
            [<em class="replaceable"><code>debug_options</code></em>]</code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:o,/tmp/mysqlbinlog.trace</code>.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_debug-check"></a>
            <a class="indexterm" name="idm46444419203104"></a>

            <a class="indexterm" name="idm46444419201616"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_debug-check"><code class="option">--debug-check</code></a>
          </p><p>
            Print some debugging information when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_debug-info"></a>
            <a class="indexterm" name="idm46444419195584"></a>

            <a class="indexterm" name="idm46444419194096"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_debug-info"><code class="option">--debug-info</code></a>
          </p><p>
            Print debugging information and memory and CPU usage
            statistics when the program exits.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_default-auth"></a>
            <a class="indexterm" name="idm46444419187952"></a>

            <a class="indexterm" name="idm46444419186464"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_default-auth"><code class="option">--default-auth=<em class="replaceable"><code>plugin</code></em></code></a>
          </p><p>
            A hint about which client-side authentication plugin to use.
            See <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444419181360"></a>

            <a class="indexterm" name="idm46444419179904"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file. If the file does not
            exist or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_defaults-file"></a>
            <a class="indexterm" name="idm46444419173568"></a>

            <a class="indexterm" name="idm46444419172080"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_defaults-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            Use only the given option file. If the file does not exist
            or is otherwise inaccessible, an error occurs.
            <em class="replaceable"><code>file_name</code></em> is interpreted relative
            to the current directory if given as a relative path name
            rather than a full path name.
          </p><p>
            Exception: Even with
            <a class="link" href="programs.html#option_general_defaults-file"><code class="option">--defaults-file</code></a>, client
            programs read <code class="filename">.mylogin.cnf</code>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444419163600"></a>

            <a class="indexterm" name="idm46444419162096"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>str</code></em></code></a>
          </p><p>
            Read not only the usual option groups, but also groups with
            the usual names and a suffix of
            <em class="replaceable"><code>str</code></em>. For example,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> normally reads the
            <code class="literal">[client]</code> and
            <code class="literal">[mysqlbinlog]</code> groups. If the
            <a class="link" href="programs.html#option_mysqlbinlog_defaults-group-suffix"><code class="option">--defaults-group-suffix=_other</code></a>
            option is given, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> also reads
            the <code class="literal">[client_other]</code> and
            <code class="literal">[mysqlbinlog_other]</code> groups.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_disable-log-bin"></a>
            <a class="indexterm" name="idm46444419149536"></a>

            <a class="indexterm" name="idm46444419148048"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_disable-log-bin"><code class="option">--disable-log-bin</code></a>,
            <code class="option">-D</code>
          </p><p>
            Disable binary logging. This is useful for avoiding an
            endless loop if you use the
            <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a> option and
            are sending the output to the same MySQL server. This option
            also is useful when restoring after a crash to avoid
            duplication of the statements you have logged.
          </p><p>
            This option causes <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to include
            a <a class="link" href="sql-statements.html#set-sql-log-bin" title="13.4.1.3 SET sql_log_bin Statement"><code class="literal">SET
            sql_log_bin = 0</code></a> statement in its output to disable
            binary logging of the remaining output. Manipulating the
            session value of the
            <a class="link" href="replication.html#sysvar_sql_log_bin"><code class="literal">sql_log_bin</code></a> system variable
            is a restricted operation, so this option requires that you
            have privileges sufficient to set restricted session
            variables. See <a class="xref" href="server-administration.html#system-variable-privileges" title="5.1.9.1 System Variable Privileges">Section 5.1.9.1, “System Variable Privileges”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_exclude-gtids"></a>
            <a class="indexterm" name="idm46444419136848"></a>

            <a class="indexterm" name="idm46444419135360"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_exclude-gtids"><code class="option">--exclude-gtids=<em class="replaceable"><code>gtid_set</code></em></code></a>
          </p><p>
            Do not display any of the groups listed in the
            <em class="replaceable"><code>gtid_set</code></em>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_force-if-open"></a>
            <a class="indexterm" name="idm46444419130528"></a>

            <a class="indexterm" name="idm46444419129040"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_force-if-open"><code class="option">--force-if-open</code></a>,
            <code class="option">-F</code>
          </p><p>
            Read binary log files even if they are open or were not
            closed properly.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_force-read"></a>
            <a class="indexterm" name="idm46444419124432"></a>

            <a class="indexterm" name="idm46444419122944"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_force-read"><code class="option">--force-read</code></a>,
            <code class="option">-f</code>
          </p><p>
            With this option, if <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reads a
            binary log event that it does not recognize, it prints a
            warning, ignores the event, and continues. Without this
            option, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> stops if it reads
            such an event.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_get-server-public-key"></a>
            <a class="indexterm" name="idm46444419115776"></a>

            <a class="indexterm" name="idm46444419114272"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_get-server-public-key"><code class="option">--get-server-public-key</code></a>
          </p><p>
            Request from the server the public key required for RSA key
            pair-based password exchange. This option applies to clients
            that authenticate with the
            <code class="literal">caching_sha2_password</code> authentication
            plugin. For that plugin, the server does not send the public
            key unless requested. This option is ignored for accounts
            that do not authenticate with that plugin. It is also
            ignored if RSA-based password exchange is not used, as is
            the case when the client connects to the server using a
            secure connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlbinlog_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlbinlog_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For information about the
            <code class="literal">caching_sha2_password</code> plugin, see
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_hexdump"></a>
            <a class="indexterm" name="idm46444419104160"></a>

            <a class="indexterm" name="idm46444419102672"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_hexdump"><code class="option">--hexdump</code></a>,
            <code class="option">-H</code>
          </p><p>
            Display a hex dump of the log in comments, as described in
            <a class="xref" href="programs.html#mysqlbinlog-hexdump" title="4.6.8.1 mysqlbinlog Hex Dump Format">Section 4.6.8.1, “mysqlbinlog Hex Dump Format”</a>. The hex output can be
            helpful for replication debugging.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_host"></a>
            <a class="indexterm" name="idm46444419097344"></a>

            <a class="indexterm" name="idm46444419095888"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_host"><code class="option">--host=<em class="replaceable"><code>host_name</code></em></code></a>,
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Get the binary log from the MySQL server on the given host.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_idempotent"></a>
            <a class="indexterm" name="idm46444419090784"></a>

            <a class="indexterm" name="idm46444419089296"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_idempotent"><code class="option">--idempotent</code></a>
          </p><p>
            Tell the MySQL Server to use idempotent mode while
            processing updates; this causes suppression of any
            duplicate-key or key-not-found errors that the server
            encounters in the current session while processing updates.
            This option may prove useful whenever it is desirable or
            necessary to replay one or more binary logs to a MySQL
            Server which may not contain all of the data to which the
            logs refer.
          </p><p>
            The scope of effect for this option includes the current
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> client and session only.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_include-gtids"></a>
            <a class="indexterm" name="idm46444419083040"></a>

            <a class="indexterm" name="idm46444419081552"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_include-gtids"><code class="option">--include-gtids=<em class="replaceable"><code>gtid_set</code></em></code></a>
          </p><p>
            Display only the groups listed in the
            <em class="replaceable"><code>gtid_set</code></em>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_local-load"></a>
            <a class="indexterm" name="idm46444419076672"></a>

            <a class="indexterm" name="idm46444419075184"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_local-load"><code class="option">--local-load=<em class="replaceable"><code>dir_name</code></em></code></a>,
            <code class="option">-l <em class="replaceable"><code>dir_name</code></em></code>
          </p><p>
            For data loading operations corresponding to
            <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a> statements,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> extracts the files from the
            binary log events, writes them as temporary ffiles to the
            local file system, and writes
            <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA
            LOCAL</code></a> statements to cause the files to be loaded.
            By default, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes these
            temporary files to an operating system-specific directory.
            The <a class="link" href="programs.html#option_mysqlbinlog_local-load"><code class="option">--local-load</code></a> option
            can be used to explicitly specify the directory where
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> should prepare local
            temporary files.
          </p><p>
            Because other processes can write files to the default
            system-specific directory, it is advisable to specify the
            <a class="link" href="programs.html#option_mysqlbinlog_local-load"><code class="option">--local-load</code></a> option to
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to designate a different
            directory for data files, and then designate that same
            directory by specifying the
            <a class="link" href="programs.html#option_mysql_load-data-local-dir"><code class="option">--load-data-local-dir</code></a> option
            to <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> when processing the output from
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>. For example:
          </p><pre data-lang="terminal" class="programlisting">mysqlbinlog --local-load=/my/local/data ...
| mysql --load-data-local-dir=/my/local/data ...</pre>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
              These temporary files are not automatically removed by
              <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> or any other MySQL program.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlbinlog_login-path"></a>
            <a class="indexterm" name="idm46444419052928"></a>

            <a class="indexterm" name="idm46444419051440"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_no-defaults"></a>
            <a class="indexterm" name="idm46444419042528"></a>

            <a class="indexterm" name="idm46444419041040"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_no-defaults"><code class="option">--no-defaults</code></a>
          </p><p>
            Do not read any option files. If program startup fails due
            to reading unknown options from an option file,
            <a class="link" href="programs.html#option_mysqlbinlog_no-defaults"><code class="option">--no-defaults</code></a> can be
            used to prevent them from being read.
          </p><p>
            The exception is that the <code class="filename">.mylogin.cnf</code>
            file, if it exists, is read in all cases. This permits
            passwords to be specified in a safer way than on the command
            line even when
            <a class="link" href="programs.html#option_mysqlbinlog_no-defaults"><code class="option">--no-defaults</code></a> is used.
            (<code class="filename">.mylogin.cnf</code> is created by the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.)
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_offset"></a>
            <a class="indexterm" name="idm46444419029648"></a>

            <a class="indexterm" name="idm46444419028160"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_offset"><code class="option">--offset=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-o <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Skip the first <em class="replaceable"><code>N</code></em> entries in the
            log.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_open-files-limit"></a>
            <a class="link" href="programs.html#option_mysqlbinlog_open-files-limit"><code class="option">--open-files-limit=<em class="replaceable"><code>N</code></em></code></a>
          </p><a class="indexterm" name="idm46444419021216"></a><a class="indexterm" name="idm46444419019728"></a><p>
            Specify the number of open file descriptors to reserve.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_password"></a>
            <a class="indexterm" name="idm46444419016720"></a>

            <a class="indexterm" name="idm46444419015232"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--password[=<em class="replaceable"><code>password</code></em>]</code></a>,
            <code class="option">-p[<em class="replaceable"><code>password</code></em>]</code>
          </p><p>
            The password of the MySQL account used for connecting to the
            server. The password value is optional. If not given,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> prompts for one. If given,
            there must be <span class="emphasis"><em>no space</em></span> between
            <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--password=</code></a> or
            <code class="option">-p</code> and the password following it. If no
            password option is specified, the default is to send no
            password.
          </p><p>
            Specifying a password on the command line should be
            considered insecure. To avoid giving the password on the
            command line, use an option file. See
            <a class="xref" href="security.html#password-security-user" title="6.1.2.1 End-User Guidelines for Password Security">Section 6.1.2.1, “End-User Guidelines for Password Security”</a>.
          </p><p>
            To explicitly specify that there is no password and that
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> should not prompt for one,
            use the
            <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--skip-password</code></a>
            option.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_plugin-dir"></a>
            <a class="indexterm" name="idm46444419002528"></a>

            <a class="indexterm" name="idm46444419001040"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_plugin-dir"><code class="option">--plugin-dir=<em class="replaceable"><code>dir_name</code></em></code></a>
          </p><p>
            The directory in which to look for plugins. Specify this
            option if the
            <a class="link" href="programs.html#option_mysqlbinlog_default-auth"><code class="option">--default-auth</code></a> option is
            used to specify an authentication plugin but
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> does not find it. See
            <a class="xref" href="security.html#pluggable-authentication" title="6.2.17 Pluggable Authentication">Section 6.2.17, “Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_port"></a>
            <a class="indexterm" name="idm46444418993616"></a>

            <a class="indexterm" name="idm46444418992160"></a>

            <a class="indexterm" name="idm46444418990672"></a>

            <a class="indexterm" name="idm46444418989600"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_port"><code class="option">--port=<em class="replaceable"><code>port_num</code></em></code></a>,
            <code class="option">-P <em class="replaceable"><code>port_num</code></em></code>
          </p><p>
            The TCP/IP port number to use for connecting to a remote
            server.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_print-defaults"></a>
            <a class="indexterm" name="idm46444418984944"></a>

            <a class="indexterm" name="idm46444418983456"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_print-defaults"><code class="option">--print-defaults</code></a>
          </p><p>
            Print the program name and all options that it gets from
            option files.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_print-table-metadata"></a>
            <a class="indexterm" name="idm46444418978160"></a>

            <a class="indexterm" name="idm46444418976704"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_print-table-metadata"><code class="option">--print-table-metadata</code></a>
          </p><p>
            Print table related metadata from the binary log. Configure
            the amount of table related metadata binary logged using
            <a class="link" href="replication.html#sysvar_binlog_row_metadata"><code class="literal">binlog-row-metadata</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_protocol"></a>
            <a class="indexterm" name="idm46444418971136"></a>

            <a class="indexterm" name="idm46444418969648"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_protocol"><code class="option">--protocol={TCP|SOCKET|PIPE|MEMORY}</code></a>
          </p><p>
            The connection protocol to use for connecting to the server.
            It is useful when the other connection parameters normally
            result in use of a protocol other than the one you want. For
            details on the permissible values, see
            <a class="xref" href="programs.html#connecting" title="4.2.4 Connecting to the MySQL Server Using Command Options">Section 4.2.4, “Connecting to the MySQL Server Using Command Options”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_raw"></a>
            <a class="indexterm" name="idm46444418964640"></a>

            <a class="indexterm" name="idm46444418963184"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>
          </p><p>
            By default, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reads binary log
            files and writes events in text format. The
            <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a> option tells
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to write them in their
            original binary format. Its use requires that
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
            also be used because the files are requested from a server.
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes one output file for
            each file read from the server. The
            <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a> option can be used
            to make a backup of a server's binary log. With the
            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a> option, the
            backup is <span class="quote">“<span class="quote">live</span>”</span> because
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> stays connected to the
            server. By default, output files are written in the current
            directory with the same names as the original log files.
            Output file names can be modified using the
            <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> option.
            For more information, see
            <a class="xref" href="programs.html#mysqlbinlog-backup" title="4.6.8.3 Using mysqlbinlog to Back Up Binary Log Files">Section 4.6.8.3, “Using mysqlbinlog to Back Up Binary Log Files”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_read-from-remote-master"></a>
            <a class="indexterm" name="idm46444418947232"></a>

            <a class="indexterm" name="idm46444418945728"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-master"><code class="option">--read-from-remote-master=<em class="replaceable"><code>type</code></em></code></a>
          </p><p>
            Read binary logs from a MySQL server with the
            <code class="literal">COM_BINLOG_DUMP</code> or
            <code class="literal">COM_BINLOG_DUMP_GTID</code> commands by setting
            the option value to either
            <code class="literal">BINLOG-DUMP-NON-GTIDS</code> or
            <code class="literal">BINLOG-DUMP-GTIDS</code>, respectively. If
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-master"><code class="option">--read-from-remote-master=BINLOG-DUMP-GTIDS</code></a>
            is combined with
            <a class="link" href="programs.html#option_mysqlbinlog_exclude-gtids"><code class="option">--exclude-gtids</code></a>,
            transactions can be filtered out on the master, avoiding
            unnecessary network traffic.
          </p><p>
            The connection parameter options are used with this option
            or the
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
            option. These options are
            <a class="link" href="programs.html#option_mysqlbinlog_host"><code class="option">--host</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--password</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_port"><code class="option">--port</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_protocol"><code class="option">--protocol</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_socket"><code class="option">--socket</code></a>, and
            <a class="link" href="programs.html#option_mysqlbinlog_user"><code class="option">--user</code></a>. If neither of
            the remote options is specified, the connection parameter
            options are ignored.
          </p><p>
            The <a class="link" href="security.html#priv_replication-slave"><code class="literal">REPLICATION SLAVE</code></a>
            privilege is required to use this option.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_read-from-remote-server"></a>
            <a class="indexterm" name="idm46444418926640"></a>

            <a class="indexterm" name="idm46444418925136"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>,
            <code class="option">-R</code>
          </p><p>
            Read the binary log from a MySQL server rather than reading
            a local log file. This option requires that the remote
            server be running. It works only for binary log files on the
            remote server, not relay log files.
          </p><p>
            The connection parameter options are used with this option
            or the
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-master"><code class="option">--read-from-remote-master</code></a>
            option. These options are
            <a class="link" href="programs.html#option_mysqlbinlog_host"><code class="option">--host</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--password</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_port"><code class="option">--port</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_protocol"><code class="option">--protocol</code></a>,
            <a class="link" href="programs.html#option_mysqlbinlog_socket"><code class="option">--socket</code></a>, and
            <a class="link" href="programs.html#option_mysqlbinlog_user"><code class="option">--user</code></a>. If neither of
            the remote options is specified, the connection parameter
            options are ignored.
          </p><p>
            The <a class="link" href="security.html#priv_replication-slave"><code class="literal">REPLICATION SLAVE</code></a>
            privilege is required to use this option.
          </p><p>
            This option is like
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-master"><code class="option">--read-from-remote-master=BINLOG-DUMP-NON-GTIDS</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_result-file"></a>
            <a class="indexterm" name="idm46444418909648"></a>

            <a class="indexterm" name="idm46444418908160"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file=<em class="replaceable"><code>name</code></em></code></a>,
            <code class="option">-r <em class="replaceable"><code>name</code></em></code>
          </p><p>
            Without the <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>
            option, this option indicates the file to which
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes text output. With
            <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes one binary output file
            for each log file transferred from the server, writing them
            by default in the current directory using the same names as
            the original log file. In this case, the
            <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> option
            value is treated as a prefix that modifies output file
            names.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_require-row-format"></a>
            <a class="indexterm" name="idm46444418897280"></a>

            <a class="indexterm" name="idm46444418895824"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_require-row-format"><code class="option">--require-row-format</code></a>
          </p><p>
            Require row-based binary logging format for events. This
            option enforces row-based replication events for
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> output. The stream of events
            produced with this option would be accepted by a replication
            channel that is secured using the
            <code class="literal">REQUIRE_ROW_FORMAT</code> option of the
            <a class="link" href="sql-statements.html#change-master-to" title="13.4.2.1 CHANGE MASTER TO Statement"><code class="literal">CHANGE MASTER TO</code></a> statement.
            <a class="link" href="replication.html#sysvar_binlog_format"><code class="literal">binlog_format=ROW</code></a> must be
            set on the server where the binary log was written. When you
            specify this option, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> stops
            with an error message if it encounters any events that are
            disallowed under the <code class="literal">REQUIRE_ROW_FORMAT</code>
            restrictions, including <code class="literal">LOAD DATA INFILE</code>
            instructions, creating or dropping temporary tables,
            <code class="literal">INTVAR</code>, <code class="literal">RAND</code>, or
            <code class="literal">USER_VAR</code> events, and non-row-based events
            within a DML transaction. <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>
            also prints a <code class="literal">SET
            @@session.require_row_format</code> statement at the
            start of its output to apply the restrictions when the
            output is executed, and does not print the <code class="literal">SET
            @@session.pseudo_thread_id</code> statement.
          </p><p>
            This option was added in MySQL 8.0.19.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_rewrite-db"></a>
            <a class="indexterm" name="idm46444418878528"></a>

            <a class="indexterm" name="idm46444418877040"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_rewrite-db"><code class="option">--rewrite-db='<em class="replaceable"><code>from_name</code></em>-&gt;<em class="replaceable"><code>to_name</code></em>'</code></a>
          </p><p>
            When reading from a row-based or statement-based log,
            rewrite all occurrences of
            <em class="replaceable"><code>from_name</code></em> to
            <em class="replaceable"><code>to_name</code></em>. Rewriting is done on the
            rows, for row-based logs, as well as on the
            <a class="link" href="sql-statements.html#use" title="13.8.4 USE Statement"><code class="literal">USE</code></a> clauses, for
            statement-based logs.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
              Statements in which table names are qualified with
              database names are not rewritten to use the new name when
              using this option.
</p>
</div>
<p>
            The rewrite rule employed as a value for this option is a
            string having the form
            <code class="literal">'<em class="replaceable"><code>from_name</code></em>-&gt;<em class="replaceable"><code>to_name</code></em>'</code>,
            as shown previously, and for this reason must be enclosed by
            quotation marks.
          </p><p>
            To employ multiple rewrite rules, specify the option
            multiple times, as shown here:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog --rewrite-db='dbcurrent-&gt;dbold' --rewrite-db='dbtest-&gt;dbcurrent' \
                     binlog.00001 &gt; /tmp/statements.sql</code></strong>
</pre><p>
            When used together with the
            <a class="link" href="programs.html#option_mysqlbinlog_database"><code class="option">--database</code></a> option, the
            <code class="option">--rewrite-db</code> option is applied first; then
            <code class="option">--database</code> option is applied, using the
            rewritten database name. The order in which the options are
            provided makes no difference in this regard.
          </p><p>
            This means that, for example, if
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> is started with
            <code class="option">--rewrite-db='mydb-&gt;yourdb'
            --database=yourdb</code>, then all updates to any tables
            in databases <code class="literal">mydb</code> and
            <code class="literal">yourdb</code> are included in the output. On the
            other hand, if it is started with
            <code class="option">--rewrite-db='mydb-&gt;yourdb'
            --database=mydb</code>, then
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> outputs no statements at all:
            since all updates to <code class="literal">mydb</code> are first
            rewritten as updates to <code class="literal">yourdb</code> before
            applying the <code class="option">--database</code> option, there
            remain no updates that match
            <code class="option">--database=mydb</code>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_server-id"></a>
            <a class="indexterm" name="idm46444418853632"></a>

            <a class="indexterm" name="idm46444418852144"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_server-id"><code class="option">--server-id=<em class="replaceable"><code>id</code></em></code></a>
          </p><p>
            Display only those events created by the server having the
            given server ID.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_server-id-bits"></a>
            <a class="indexterm" name="idm46444418847760"></a>

            <a class="indexterm" name="idm46444418846272"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_server-id-bits"><code class="option">--server-id-bits=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Use only the first <em class="replaceable"><code>N</code></em> bits of the
            <a class="link" href="replication.html#sysvar_server_id"><code class="literal">server_id</code></a> to identify the
            server. If the binary log was written by a
            <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> with server-id-bits set to less
            than 32 and user data stored in the most significant bit,
            running <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> with
            <code class="option">--server-id-bits</code> set to 32 enables this
            data to be seen.
          </p><p>
            This option is supported only by the version of
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> supplied with the NDB Cluster
            distribution, or built with NDB Cluster support.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_server-public-key-path"></a>
            <a class="indexterm" name="idm46444418835328"></a>

            <a class="indexterm" name="idm46444418833824"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
          </p><p>
            The path name to a file in PEM format containing a
            client-side copy of the public key required by the server
            for RSA key pair-based password exchange. This option
            applies to clients that authenticate with the
            <code class="literal">sha256_password</code> or
            <code class="literal">caching_sha2_password</code> authentication
            plugin. This option is ignored for accounts that do not
            authenticate with one of those plugins. It is also ignored
            if RSA-based password exchange is not used, as is the case
            when the client connects to the server using a secure
            connection.
          </p><p>
            If
            <a class="link" href="programs.html#option_mysqlbinlog_server-public-key-path"><code class="option">--server-public-key-path=<em class="replaceable"><code>file_name</code></em></code></a>
            is given and specifies a valid public key file, it takes
            precedence over
            <a class="link" href="programs.html#option_mysqlbinlog_get-server-public-key"><code class="option">--get-server-public-key</code></a>.
          </p><p>
            For <code class="literal">sha256_password</code>, this option applies
            only if MySQL was built using OpenSSL.
          </p><p>
            For information about the <code class="literal">sha256_password</code>
            and <code class="literal">caching_sha2_password</code> plugins, see
            <a class="xref" href="security.html#sha256-pluggable-authentication" title="6.4.1.3 SHA-256 Pluggable Authentication">Section 6.4.1.3, “SHA-256 Pluggable Authentication”</a>, and
            <a class="xref" href="security.html#caching-sha2-pluggable-authentication" title="6.4.1.2 Caching SHA-2 Pluggable Authentication">Section 6.4.1.2, “Caching SHA-2 Pluggable Authentication”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_set-charset"></a>
            <a class="indexterm" name="idm46444418820080"></a>

            <a class="indexterm" name="idm46444418818592"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_set-charset"><code class="option">--set-charset=<em class="replaceable"><code>charset_name</code></em></code></a>
          </p><p>
            Add a <a class="link" href="sql-statements.html#set-names" title="13.7.6.3 SET NAMES Statement"><code class="literal">SET NAMES
            <em class="replaceable"><code>charset_name</code></em></code></a> statement
            to the output to specify the character set to be used for
            processing log files.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_shared-memory-base-name"></a>
            <a class="indexterm" name="idm46444418812592"></a>

            <a class="indexterm" name="idm46444418811088"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_shared-memory-base-name"><code class="option">--shared-memory-base-name=<em class="replaceable"><code>name</code></em></code></a>
          </p><p>
            On Windows, the shared-memory name to use for connections
            made using shared memory to a local server. The default
            value is <code class="literal">MYSQL</code>. The shared-memory name is
            case-sensitive.
          </p><p>
            This option applies only if the server was started with the
            <a class="link" href="server-administration.html#sysvar_shared_memory"><code class="literal">shared_memory</code></a> system
            variable enabled to support shared-memory connections.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_short-form"></a>
            <a class="indexterm" name="idm46444418804032"></a>

            <a class="indexterm" name="idm46444418802544"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_short-form"><code class="option">--short-form</code></a>,
            <code class="option">-s</code>
          </p><p>
            Display only the statements contained in the log, without
            any extra information or row-based events. This is for
            testing only, and should not be used in production systems.
            It is deprecated, and will be removed in a future release.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_skip-gtids"></a>
            <a class="indexterm" name="idm46444418797824"></a>

            <a class="indexterm" name="idm46444418796336"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_skip-gtids"><code class="option">--skip-gtids[=(true|false)]</code></a>
          </p><p>
            Do not display any GTIDs in the output. This is needed when
            writing to a dump file from one or more binary logs
            containing GTIDs, as shown in this example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog --skip-gtids binlog.000001 &gt;  /tmp/dump.sql</code></strong>
shell&gt; <strong class="userinput"><code>mysqlbinlog --skip-gtids binlog.000002 &gt;&gt; /tmp/dump.sql</code></strong>
shell&gt; <strong class="userinput"><code>mysql -u root -p -e "source /tmp/dump.sql"</code></strong>
</pre><p>
            The use of this option is otherwise not normally recommended
            in production.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_socket"></a>
            <a class="indexterm" name="idm46444418788336"></a>

            <a class="indexterm" name="idm46444418786848"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_socket"><code class="option">--socket=<em class="replaceable"><code>path</code></em></code></a>,
            <code class="option">-S <em class="replaceable"><code>path</code></em></code>
          </p><p>
            For connections to <code class="literal">localhost</code>, the Unix
            socket file to use, or, on Windows, the name of the named
            pipe to use.
          </p><p>
            On Windows, this option applies only if the server was
            started with the <a class="link" href="server-administration.html#sysvar_named_pipe"><code class="literal">named_pipe</code></a>
            system variable enabled to support named-pipe connections.
            In addition, the user making the connection must be a member
            of the Windows group specified by the
            <a class="link" href="server-administration.html#sysvar_named_pipe_full_access_group"><code class="literal">named_pipe_full_access_group</code></a>
            system variable.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_ssl"></a>
            <a class="indexterm" name="idm46444418777808"></a>

            <a class="indexterm" name="idm46444418776352"></a>

            <code class="option">--ssl*</code>
          </p><p>
            Options that begin with <code class="option">--ssl</code> specify
            whether to connect to the server using SSL and indicate
            where to find SSL keys and certificates. See
            <a class="xref" href="programs.html#encrypted-connection-options" title="Command Options for Encrypted Connections">Command Options for Encrypted Connections</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_ssl-fips-mode"></a>
            <a class="link" href="programs.html#option_mysqlbinlog_ssl-fips-mode"><code class="option">--ssl-fips-mode={OFF|ON|STRICT}</code></a>
          </p><a class="indexterm" name="idm46444418770400"></a><p>
            Controls whether to enable FIPS mode on the client side. The
            <a class="link" href="programs.html#option_mysqlbinlog_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> option
            differs from other
            <code class="option">--ssl-<em class="replaceable"><code>xxx</code></em></code>
            options in that it is not used to establish encrypted
            connections, but rather to affect which cryptographic
            operations to permit. See <a class="xref" href="security.html#fips-mode" title="6.5 FIPS Support">Section 6.5, “FIPS Support”</a>.
          </p><p>
            These <a class="link" href="programs.html#option_mysqlbinlog_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a>
            values are permitted:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">OFF</code>: Disable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">ON</code>: Enable FIPS mode.
              </p></li><li class="listitem"><p>
                <code class="literal">STRICT</code>: Enable <span class="quote">“<span class="quote">strict</span>”</span>
                FIPS mode.
</p></li></ul>
</div>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<div class="admon-title">
Note
</div>
<p>
              If the OpenSSL FIPS Object Module is not available, the
              only permitted value for
              <a class="link" href="programs.html#option_mysqlbinlog_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> is
              <code class="literal">OFF</code>. In this case, setting
              <a class="link" href="programs.html#option_mysqlbinlog_ssl-fips-mode"><code class="option">--ssl-fips-mode</code></a> to
              <code class="literal">ON</code> or <code class="literal">STRICT</code> causes
              the client to produce a warning at startup and to operate
              in non-FIPS mode.
</p>
</div>
</li><li class="listitem"><p><a name="option_mysqlbinlog_start-datetime"></a>
            <a class="indexterm" name="idm46444418753344"></a>

            <a class="indexterm" name="idm46444418751856"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_start-datetime"><code class="option">--start-datetime=<em class="replaceable"><code>datetime</code></em></code></a>
          </p><p>
            Start reading the binary log at the first event having a
            timestamp equal to or later than the
            <em class="replaceable"><code>datetime</code></em> argument. The
            <em class="replaceable"><code>datetime</code></em> value is relative to the
            local time zone on the machine where you run
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>. The value should be in a
            format accepted for the
            <a class="link" href="data-types.html#datetime" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">DATETIME</code></a> or
            <a class="link" href="data-types.html#datetime" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types"><code class="literal">TIMESTAMP</code></a> data types. For
            example:
          </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog --start-datetime="2005-12-25 11:25:56" binlog.000003</code></strong>
</pre><p>
            This option is useful for point-in-time recovery. See
            <a class="xref" href="backup-and-recovery.html#point-in-time-recovery" title="7.5 Point-in-Time (Incremental) Recovery Using the Binary Log">Section 7.5, “Point-in-Time (Incremental) Recovery Using the Binary Log”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_start-position"></a>
            <a class="indexterm" name="idm46444418739792"></a>

            <a class="indexterm" name="idm46444418738304"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_start-position"><code class="option">--start-position=<em class="replaceable"><code>N</code></em></code></a>,
            <code class="option">-j <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Start reading the binary log at the first event having a
            position equal to or greater than
            <em class="replaceable"><code>N</code></em>. This option applies to the
            first log file named on the command line.
          </p><p>
            This option is useful for point-in-time recovery. See
            <a class="xref" href="backup-and-recovery.html#point-in-time-recovery" title="7.5 Point-in-Time (Incremental) Recovery Using the Binary Log">Section 7.5, “Point-in-Time (Incremental) Recovery Using the Binary Log”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_stop-datetime"></a>
            <a class="indexterm" name="idm46444418731520"></a>

            <a class="indexterm" name="idm46444418730032"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_stop-datetime"><code class="option">--stop-datetime=<em class="replaceable"><code>datetime</code></em></code></a>
          </p><p>
            Stop reading the binary log at the first event having a
            timestamp equal to or later than the
            <em class="replaceable"><code>datetime</code></em> argument. See the
            description of the
            <a class="link" href="programs.html#option_mysqlbinlog_start-datetime"><code class="option">--start-datetime</code></a> option
            for information about the
            <em class="replaceable"><code>datetime</code></em> value.
          </p><p>
            This option is useful for point-in-time recovery. See
            <a class="xref" href="backup-and-recovery.html#point-in-time-recovery" title="7.5 Point-in-Time (Incremental) Recovery Using the Binary Log">Section 7.5, “Point-in-Time (Incremental) Recovery Using the Binary Log”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_stop-never"></a>
            <a class="indexterm" name="idm46444418722400"></a>

            <a class="indexterm" name="idm46444418720912"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a>
          </p><p>
            This option is used with
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>.
            It tells <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to remain connected
            to the server. Otherwise <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>
            exits when the last log file has been transferred from the
            server. <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a>
            implies <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a>,
            so only the first log file to transfer need be named on the
            command line.
          </p><p>
            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a> is commonly
            used with <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a> to make
            a live binary log backup, but also can be used without
            <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a> to maintain a
            continuous text display of log events as the server
            generates them.
          </p><p>
            With <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a>, by
            default, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reports a server ID
            of 1 when it connects to the server. Use
            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id</code></a>
            to explicitly specify an alternative ID to report. It can be
            used to avoid a conflict with the ID of a slave server or
            another <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> process. See
            <a class="xref" href="programs.html#mysqlbinlog-server-id" title="4.6.8.4 Specifying the mysqlbinlog Server ID">Section 4.6.8.4, “Specifying the mysqlbinlog Server ID”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_stop-never-slave-server-id"></a>
            <a class="indexterm" name="idm46444418701824"></a>

            <a class="indexterm" name="idm46444418700320"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_stop-never-slave-server-id"><code class="option">--stop-never-slave-server-id=<em class="replaceable"><code>id</code></em></code></a>
          </p><p>
            This option is deprecated and will be removed in a future
            release. Use the
            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id</code></a>
            option instead to specify a server ID for mysqlbinlog to
            report.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_stop-position"></a>
            <a class="indexterm" name="idm46444418694752"></a>

            <a class="indexterm" name="idm46444418693264"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_stop-position"><code class="option">--stop-position=<em class="replaceable"><code>N</code></em></code></a>
          </p><p>
            Stop reading the binary log at the first event having a
            position equal to or greater than
            <em class="replaceable"><code>N</code></em>. This option applies to the
            last log file named on the command line.
          </p><p>
            This option is useful for point-in-time recovery. See
            <a class="xref" href="backup-and-recovery.html#point-in-time-recovery" title="7.5 Point-in-Time (Incremental) Recovery Using the Binary Log">Section 7.5, “Point-in-Time (Incremental) Recovery Using the Binary Log”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_tls-ciphersuites"></a>
            <a class="indexterm" name="idm46444418687216"></a>

            <a class="indexterm" name="idm46444418685728"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_tls-ciphersuites"><code class="option">--tls-ciphersuites=<em class="replaceable"><code>ciphersuite_list</code></em></code></a>
          </p><p>
            The permissible ciphersuites for encrypted connections that
            use TLSv1.3. The value is a list of one or more
            colon-separated ciphersuite names. The ciphersuites that can
            be named for this option depend on the SSL library used to
            compile MySQL. For details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p><p>
            This option was added in MySQL 8.0.16.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_tls-version"></a>
            <a class="indexterm" name="idm46444418679920"></a>

            <a class="indexterm" name="idm46444418678432"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_tls-version"><code class="option">--tls-version=<em class="replaceable"><code>protocol_list</code></em></code></a>
          </p><p>
            The permissible TLS protocols for encrypted connections. The
            value is a list of one or more comma-separated protocol
            names. The protocols that can be named for this option
            depend on the SSL library used to compile MySQL. For
            details, see
            <a class="xref" href="security.html#encrypted-connection-protocols-ciphers" title="6.3.2 Encrypted Connection TLS Protocols and Ciphers">Section 6.3.2, “Encrypted Connection TLS Protocols and Ciphers”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_to-last-log"></a>
            <a class="indexterm" name="idm46444418673120"></a>

            <a class="indexterm" name="idm46444418671632"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a>,
            <code class="option">-t</code>
          </p><p>
            Do not stop at the end of the requested binary log from a
            MySQL server, but rather continue printing until the end of
            the last binary log. If you send the output to the same
            MySQL server, this may lead to an endless loop. This option
            requires
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_user"></a>
            <a class="indexterm" name="idm46444418665888"></a>

            <a class="indexterm" name="idm46444418664432"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_user"><code class="option">--user=<em class="replaceable"><code>user_name</code></em></code></a>,
            <code class="option">-u <em class="replaceable"><code>user_name</code></em></code>
          </p><p>
            The user name of the MySQL account to use when connecting to
            a remote server.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_verbose"></a>
            <a class="indexterm" name="idm46444418659232"></a>

            <a class="indexterm" name="idm46444418657744"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Reconstruct row events and display them as commented SQL
            statements, with table partition information where
            applicable. If this option is given twice (by passing in
            either "-vv" or "--verbose --verbose"), the output includes
            comments to indicate column data types and some metadata,
            and informational log events such as row query log events if
            the
            <a class="link" href="replication.html#sysvar_binlog_rows_query_log_events"><code class="literal">binlog_rows_query_log_events</code></a>
            system variable is set to <code class="literal">TRUE</code>.
          </p><p>
            For examples that show the effect of
            <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output</code></a> and
            <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> on row event
            output, see <a class="xref" href="programs.html#mysqlbinlog-row-events" title="4.6.8.2 mysqlbinlog Row Event Display">Section 4.6.8.2, “mysqlbinlog Row Event Display”</a>.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_verify-binlog-checksum"></a>
            <a class="indexterm" name="idm46444418647552"></a>

            <a class="indexterm" name="idm46444418646048"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_verify-binlog-checksum"><code class="option">--verify-binlog-checksum</code></a>,
            <code class="option">-c</code>
          </p><p>
            Verify checksums in binary log files.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_version"></a>
            <a class="indexterm" name="idm46444418641440"></a>

            <a class="indexterm" name="idm46444418639952"></a>

            <a class="link" href="programs.html#option_mysqlbinlog_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
          </p><p>
            The <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> version number shown when
            using this option is 3.4.
          </p></li><li class="listitem"><p><a name="option_mysqlbinlog_zstd-compression-level"></a>
            <a class="link" href="programs.html#option_mysqlbinlog_zstd-compression-level"><code class="option">--zstd-compression-level=<em class="replaceable"><code>level</code></em></code></a>
          </p><a class="indexterm" name="idm46444418632208"></a><a class="indexterm" name="idm46444418630704"></a><p>
            The compression level to use for connections to the server
            that use the <code class="literal">zstd</code> compression algorithm.
            The permitted levels are from 1 to 22, with larger values
            indicating increasing levels of compression. The default
            <code class="literal">zstd</code> compression level is 3. The
            compression level setting has no effect on connections that
            do not use <code class="literal">zstd</code> compression.
          </p><p>
            For more information, see
            <a class="xref" href="programs.html#connection-compression-control" title="4.2.6 Connection Compression Control">Section 4.2.6, “Connection Compression Control”</a>.
          </p><p>
            This option was added in MySQL 8.0.18.
</p></li></ul>
</div>
<p>
        You can pipe the output of <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> into
        the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client to execute the events
        contained in the binary log. This technique is used to recover
        from a crash when you have an old backup (see
        <a class="xref" href="backup-and-recovery.html#point-in-time-recovery" title="7.5 Point-in-Time (Incremental) Recovery Using the Binary Log">Section 7.5, “Point-in-Time (Incremental) Recovery Using the Binary Log”</a>). For example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000001 | mysql -u root -p</code></strong>
</pre><p>
        Or:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.[0-9]* | mysql -u root -p</code></strong>
</pre><p>
        If the statements produced by <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> may
        contain <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> values, these may
        cause problems when <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> processes them. In
        this case, invoke <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> with the
        <a class="link" href="programs.html#option_mysql_binary-mode"><code class="option">--binary-mode</code></a> option.
      </p><p>
        You can also redirect the output of
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to a text file instead, if you
        need to modify the statement log first (for example, to remove
        statements that you do not want to execute for some reason).
        After editing the file, execute the statements that it contains
        by using it as input to the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> program:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000001 &gt; tmpfile</code></strong>
shell&gt; ... <em class="replaceable"><code>edit tmpfile</code></em> ...
shell&gt; <strong class="userinput"><code>mysql -u root -p &lt; tmpfile</code></strong>
</pre><p>
        When <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> is invoked with the
        <a class="link" href="programs.html#option_mysqlbinlog_start-position"><code class="option">--start-position</code></a> option, it
        displays only those events with an offset in the binary log
        greater than or equal to a given position (the given position
        must match the start of one event). It also has options to stop
        and start when it sees an event with a given date and time. This
        enables you to perform point-in-time recovery using the
        <a class="link" href="programs.html#option_mysqlbinlog_stop-datetime"><code class="option">--stop-datetime</code></a> option (to
        be able to say, for example, <span class="quote">“<span class="quote">roll forward my databases to
        how they were today at 10:30 a.m.</span>”</span>).
      </p><p><b>Processing multiple files. </b>
          If you have more than one binary log to execute on the MySQL
          server, the safe method is to process them all using a single
          connection to the server. Here is an example that demonstrates
          what may be <span class="emphasis"><em>unsafe</em></span>:
        </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000001 | mysql -u root -p # DANGER!!</code></strong>
shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000002 | mysql -u root -p # DANGER!!</code></strong>
</pre><p>
        Processing binary logs this way using multiple connections to
        the server causes problems if the first log file contains a
        <a class="link" href="sql-statements.html#create-table" title="13.1.20 CREATE TABLE Statement"><code class="literal">CREATE TEMPORARY
        TABLE</code></a> statement and the second log contains a
        statement that uses the temporary table. When the first
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> process terminates, the server drops
        the temporary table. When the second <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>
        process attempts to use the table, the server reports
        <span class="quote">“<span class="quote">unknown table.</span>”</span>
      </p><p>
        To avoid problems like this, use a <span class="emphasis"><em>single</em></span>
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> process to execute the contents of all
        binary logs that you want to process. Here is one way to do so:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000001 binlog.000002 | mysql -u root -p</code></strong>
</pre><p>
        Another approach is to write all the logs to a single file and
        then process the file:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000001 &gt;  /tmp/statements.sql</code></strong>
shell&gt; <strong class="userinput"><code>mysqlbinlog binlog.000002 &gt;&gt; /tmp/statements.sql</code></strong>
shell&gt; <strong class="userinput"><code>mysql -u root -p -e "source /tmp/statements.sql"</code></strong>
</pre><p>
        From MySQL 8.0.12, you can also supply multiple binary log files
        to <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> as streamed input using a
        shell pipe. An archive of compressed binary log files can be
        decompressed and provided directly to
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>. In this example,
        <code class="filename">binlog-files_1.gz</code> contains multiple binary
        log files for processing. The pipeline extracts the contents of
        <code class="filename">binlog-files_1.gz</code>, pipes the binary log
        files to <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> as standard input, and
        pipes the output of <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> into the
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client for execution:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>gzip -cd binlog-files_1.gz | ./mysqlbinlog - | ./mysql -uroot  -p</code></strong>
</pre><p>
        You can specify more than one archive file, for example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>gzip -cd binlog-files_1.gz binlog-files_2.gz | ./mysqlbinlog - | ./mysql -uroot  -p</code></strong>
</pre><p>
        For streamed input, do not use
        <code class="literal">--stop-position</code>, because
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> cannot identify the last log file
        to apply this option.
      </p><p><b>LOAD DATA operations. </b>
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> can produce output that
          reproduces a <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a>
          operation without the original data file.
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> copies the data to a temporary
          file and writes a
          <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA
          LOCAL</code></a> statement that refers to the file. The default
          location of the directory where these files are written is
          system-specific. To specify a directory explicitly, use the
          <a class="link" href="programs.html#option_mysqlbinlog_local-load"><code class="option">--local-load</code></a> option.
        </p><p>
        Because <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> converts
        <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA</code></a> statements to
        <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA
        LOCAL</code></a> statements (that is, it adds
        <code class="literal">LOCAL</code>), both the client and the server that
        you use to process the statements must be configured with the
        <code class="literal">LOCAL</code> capability enabled. See
        <a class="xref" href="security.html#load-data-local-security" title="6.1.6 Security Considerations for LOAD DATA LOCAL">Section 6.1.6, “Security Considerations for LOAD DATA LOCAL”</a>.
</p>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Warning
</div>
<p>
          The temporary files created for
          <a class="link" href="sql-statements.html#load-data" title="13.2.7 LOAD DATA Statement"><code class="literal">LOAD DATA
          LOCAL</code></a> statements are <span class="emphasis"><em>not</em></span>
          automatically deleted because they are needed until you
          actually execute those statements. You should delete the
          temporary files yourself after you no longer need the
          statement log. The files can be found in the temporary file
          directory and have names like
          <em class="replaceable"><code>original_file_name-#-#</code></em>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysqlbinlog-hexdump"></a>4.6.8.1 mysqlbinlog Hex Dump Format</h4>

</div>

</div>

</div>
<p>
        The <a class="link" href="programs.html#option_mysqlbinlog_hexdump"><code class="option">--hexdump</code></a> option causes
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to produce a hex dump of the
        binary log contents:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog --hexdump master-bin.000001</code></strong>
</pre><p>
        The hex output consists of comment lines beginning with
        <code class="literal">#</code>, so the output might look like this for the
        preceding command:
      </p><pre data-lang="sql" class="programlisting">/*!40019 SET @@SESSION.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
# at 4
#051024 17:24:13 server id 1  end_log_pos 98
# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags
# 00000004 9d fc 5c 43   0f   01 00 00 00   5e 00 00 00   62 00 00 00   00 00
# 00000017 04 00 35 2e 30 2e 31 35  2d 64 65 62 75 67 2d 6c |..5.0.15.debug.l|
# 00000027 6f 67 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |og..............|
# 00000037 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |................|
# 00000047 00 00 00 00 9d fc 5c 43  13 38 0d 00 08 00 12 00 |.......C.8......|
# 00000057 04 04 04 04 12 00 00 4b  00 04 1a                |.......K...|
#       Start: binlog v 4, server v 5.0.15-debug-log created 051024 17:24:13
#       at startup
ROLLBACK;</pre><p>
        Hex dump output currently contains the elements in the following
        list. This format is subject to change. For more information
        about binary log format, see
        <a class="ulink" href="https://dev.mysql.com/doc/internals/en/binary-log.html" target="_top">MySQL
        Internals: The Binary Log</a>.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">Position</code>: The byte position within the
            log file.
          </p></li><li class="listitem"><p>
            <code class="literal">Timestamp</code>: The event timestamp. In the
            example shown, <code class="literal">'9d fc 5c 43'</code> is the
            representation of <code class="literal">'051024 17:24:13'</code> in
            hexadecimal.
          </p></li><li class="listitem"><p>
            <code class="literal">Type</code>: The event type code.
          </p></li><li class="listitem"><p>
            <code class="literal">Master ID</code>: The server ID of the master
            that created the event.
          </p></li><li class="listitem"><p>
            <code class="literal">Size</code>: The size in bytes of the event.
          </p></li><li class="listitem"><p>
            <code class="literal">Master Pos</code>: The position of the next
            event in the original master log file.
          </p></li><li class="listitem"><p>
            <code class="literal">Flags</code>: Event flag values.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysqlbinlog-row-events"></a>4.6.8.2 mysqlbinlog Row Event Display</h4>

</div>

</div>

</div>
<a class="indexterm" name="idm46444418526912"></a><p>
        The following examples illustrate how
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> displays row events that specify
        data modifications. These correspond to events with the
        <code class="literal">WRITE_ROWS_EVENT</code>,
        <code class="literal">UPDATE_ROWS_EVENT</code>, and
        <code class="literal">DELETE_ROWS_EVENT</code> type codes. The
        <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=DECODE-ROWS</code></a>
        and <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> options may be
        used to affect row event output.
      </p><p>
        Suppose that the server is using row-based binary logging and
        that you execute the following sequence of statements:
      </p><pre data-lang="sql" class="programlisting">CREATE TABLE t
(
  id   INT NOT NULL,
  name VARCHAR(20) NOT NULL,
  date DATE NULL
) ENGINE = InnoDB;

START TRANSACTION;
INSERT INTO t VALUES(1, 'apple', NULL);
UPDATE t SET name = 'pear', date = '2009-01-01' WHERE id = 1;
DELETE FROM t WHERE id = 1;
COMMIT;</pre><p>
        By default, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> displays row events
        encoded as base-64 strings using
        <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements. Omitting
        extraneous lines, the output for the row events produced by the
        preceding statement sequence looks like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog <em class="replaceable"><code>log_file</code></em></code></strong>
...
# at 218
#080828 15:03:08 server id 1  end_log_pos 258   Write_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAANoAAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBcBAAAAKAAAAAIBAAAQABEAAAAAAAEAA//8AQAAAAVhcHBsZQ==
'/*!*/;
...
# at 302
#080828 15:03:08 server id 1  end_log_pos 356   Update_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP
'/*!*/;
...
# at 400
#080828 15:03:08 server id 1  end_log_pos 442   Delete_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAAJABAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBkBAAAAKgAAALoBAAAQABEAAAAAAAEAA//4AQAAAARwZWFyIbIP
'/*!*/;
</pre><p>
        To see the row events as comments in the form of
        <span class="quote">“<span class="quote">pseudo-SQL</span>”</span> statements, run
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> with the
        <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> or
        <code class="option">-v</code> option. This output level also shows table
        partition information where applicable. The output will contain
        lines beginning with <code class="literal">###</code>:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog -v <em class="replaceable"><code>log_file</code></em></code></strong>
...
# at 218
#080828 15:03:08 server id 1  end_log_pos 258   Write_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAANoAAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBcBAAAAKAAAAAIBAAAQABEAAAAAAAEAA//8AQAAAAVhcHBsZQ==
'/*!*/;
### INSERT INTO test.t
### SET
###   @1=1
###   @2='apple'
###   @3=NULL
...
# at 302
#080828 15:03:08 server id 1  end_log_pos 356   Update_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP
'/*!*/;
### UPDATE test.t
### WHERE
###   @1=1
###   @2='apple'
###   @3=NULL
### SET
###   @1=1
###   @2='pear'
###   @3='2009:01:01'
...
# at 400
#080828 15:03:08 server id 1  end_log_pos 442   Delete_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAAJABAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBkBAAAAKgAAALoBAAAQABEAAAAAAAEAA//4AQAAAARwZWFyIbIP
'/*!*/;
### DELETE FROM test.t
### WHERE
###   @1=1
###   @2='pear'
###   @3='2009:01:01'
</pre><p>
        Specify <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> or
        <code class="option">-v</code> twice to also display data types and some
        metadata for each column, and informational log events such as
        row query log events if the
        <a class="link" href="replication.html#sysvar_binlog_rows_query_log_events"><code class="literal">binlog_rows_query_log_events</code></a>
        system variable is set to <code class="literal">TRUE</code>. The output
        will contain an additional comment following each column change:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog -vv <em class="replaceable"><code>log_file</code></em></code></strong>
...
# at 218
#080828 15:03:08 server id 1  end_log_pos 258   Write_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAANoAAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBcBAAAAKAAAAAIBAAAQABEAAAAAAAEAA//8AQAAAAVhcHBsZQ==
'/*!*/;
### INSERT INTO test.t
### SET
###   @1=1 /* INT meta=0 nullable=0 is_null=0 */
###   @2='apple' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */
###   @3=NULL /* VARSTRING(20) meta=0 nullable=1 is_null=1 */
...
# at 302
#080828 15:03:08 server id 1  end_log_pos 356   Update_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP
'/*!*/;
### UPDATE test.t
### WHERE
###   @1=1 /* INT meta=0 nullable=0 is_null=0 */
###   @2='apple' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */
###   @3=NULL /* VARSTRING(20) meta=0 nullable=1 is_null=1 */
### SET
###   @1=1 /* INT meta=0 nullable=0 is_null=0 */
###   @2='pear' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */
###   @3='2009:01:01' /* DATE meta=0 nullable=1 is_null=0 */
...
# at 400
#080828 15:03:08 server id 1  end_log_pos 442   Delete_rows: table id 17 flags: STMT_END_F

BINLOG '
fAS3SBMBAAAALAAAAJABAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ=
fAS3SBkBAAAAKgAAALoBAAAQABEAAAAAAAEAA//4AQAAAARwZWFyIbIP
'/*!*/;
### DELETE FROM test.t
### WHERE
###   @1=1 /* INT meta=0 nullable=0 is_null=0 */
###   @2='pear' /* VARSTRING(20) meta=20 nullable=0 is_null=0 */
###   @3='2009:01:01' /* DATE meta=0 nullable=1 is_null=0 */
</pre><p>
        You can tell <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to suppress the
        <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements for row events
        by using the
        <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=DECODE-ROWS</code></a>
        option. This is similar to
        <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=NEVER</code></a> but
        does not exit with an error if a row event is found. The
        combination of
        <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=DECODE-ROWS</code></a>
        and <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> provides a
        convenient way to see row events only as SQL statements:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlbinlog -v --base64-output=DECODE-ROWS <em class="replaceable"><code>log_file</code></em></code></strong>
...
# at 218
#080828 15:03:08 server id 1  end_log_pos 258   Write_rows: table id 17 flags: STMT_END_F
### INSERT INTO test.t
### SET
###   @1=1
###   @2='apple'
###   @3=NULL
...
# at 302
#080828 15:03:08 server id 1  end_log_pos 356   Update_rows: table id 17 flags: STMT_END_F
### UPDATE test.t
### WHERE
###   @1=1
###   @2='apple'
###   @3=NULL
### SET
###   @1=1
###   @2='pear'
###   @3='2009:01:01'
...
# at 400
#080828 15:03:08 server id 1  end_log_pos 442   Delete_rows: table id 17 flags: STMT_END_F
### DELETE FROM test.t
### WHERE
###   @1=1
###   @2='pear'
###   @3='2009:01:01'
</pre>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          You should not suppress <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a>
          statements if you intend to re-execute
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> output.
</p>
</div>
<p>
        The SQL statements produced by
        <a class="link" href="programs.html#option_mysqlbinlog_verbose"><code class="option">--verbose</code></a> for row events are
        much more readable than the corresponding
        <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statements. However, they
        do not correspond exactly to the original SQL statements that
        generated the events. The following limitations apply:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The original column names are lost and replaced by
            <code class="literal">@<em class="replaceable"><code>N</code></em></code>, where
            <em class="replaceable"><code>N</code></em> is a column number.
          </p></li><li class="listitem"><p>
            Character set information is not available in the binary
            log, which affects string column display:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                There is no distinction made between corresponding
                binary and nonbinary string types
                (<a class="link" href="data-types.html#binary-varbinary" title="11.3.3 The BINARY and VARBINARY Types"><code class="literal">BINARY</code></a> and
                <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">CHAR</code></a>,
                <a class="link" href="data-types.html#binary-varbinary" title="11.3.3 The BINARY and VARBINARY Types"><code class="literal">VARBINARY</code></a> and
                <a class="link" href="data-types.html#char" title="11.3.2 The CHAR and VARCHAR Types"><code class="literal">VARCHAR</code></a>,
                <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">BLOB</code></a> and
                <a class="link" href="data-types.html#blob" title="11.3.4 The BLOB and TEXT Types"><code class="literal">TEXT</code></a>). The output uses a
                data type of <code class="literal">STRING</code> for fixed-length
                strings and <code class="literal">VARSTRING</code> for
                variable-length strings.
              </p></li><li class="listitem"><p>
                For multibyte character sets, the maximum number of
                bytes per character is not present in the binary log, so
                the length for string types is displayed in bytes rather
                than in characters. For example,
                <code class="literal">STRING(4)</code> will be used as the data
                type for values from either of these column types:
              </p><pre data-lang="sql" class="programlisting">CHAR(4) CHARACTER SET latin1
CHAR(2) CHARACTER SET ucs2</pre></li><li class="listitem"><p>
                Due to the storage format for events of type
                <code class="literal">UPDATE_ROWS_EVENT</code>,
                <a class="link" href="sql-statements.html#update" title="13.2.13 UPDATE Statement"><code class="literal">UPDATE</code></a> statements are
                displayed with the <code class="literal">WHERE</code> clause
                preceding the <code class="literal">SET</code> clause.
</p></li></ul>
</div>
</li></ul>
</div>
<p>
        Proper interpretation of row events requires the information
        from the format description event at the beginning of the binary
        log. Because <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> does not know in
        advance whether the rest of the log contains row events, by
        default it displays the format description event using a
        <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statement in the initial
        part of the output.
      </p><p>
        If the binary log is known not to contain any events requiring a
        <a class="link" href="sql-statements.html#binlog" title="13.7.8.1 BINLOG Statement"><code class="literal">BINLOG</code></a> statement (that is, no row
        events), the
        <a class="link" href="programs.html#option_mysqlbinlog_base64-output"><code class="option">--base64-output=NEVER</code></a> option
        can be used to prevent this header from being written.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysqlbinlog-backup"></a>4.6.8.3 Using mysqlbinlog to Back Up Binary Log Files</h4>

</div>

</div>

</div>
<p>
        By default, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reads binary log
        files and displays their contents in text format. This enables
        you to examine events within the files more easily and to
        re-execute them (for example, by using the output as input to
        <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a>). <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> can
        read log files directly from the local file system, or, with the
        <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
        option, it can connect to a server and request binary log
        contents from that server. <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes
        text output to its standard output, or to the file named as the
        value of the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file=<em class="replaceable"><code>file_name</code></em></code></a>
        option if that option is given.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#mysqlbinlog-backup-capabilities" title="mysqlbinlog Backup Capabilities">mysqlbinlog Backup Capabilities</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlbinlog-backup-options" title="mysqlbinlog Backup Options">mysqlbinlog Backup Options</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlbinlog-backup-static-live" title="Static and Live Backups">Static and Live Backups</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlbinlog-backup-output-file-naming" title="Output File Naming">Output File Naming</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlbinlog-backup-example" title="Example: mysqldump + mysqlbinlog for Backup and Restore">Example: mysqldump + mysqlbinlog for Backup and Restore</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#mysqlbinlog-backup-restrictions" title="mysqlbinlog Backup Restrictions">mysqlbinlog Backup Restrictions</a></p></li></ul>
</div>
<h5><a name="mysqlbinlog-backup-capabilities"></a>mysqlbinlog Backup Capabilities</h5>
<p>
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> can read binary log files and
        write new files containing the same content—that is, in
        binary format rather than text format. This capability enables
        you to easily back up a binary log in its original format.
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> can make a static backup, backing
        up a set of log files and stopping when the end of the last file
        is reached. It can also make a continuous (<span class="quote">“<span class="quote">live</span>”</span>)
        backup, staying connected to the server when it reaches the end
        of the last log file and continuing to copy new events as they
        are generated. In continuous-backup operation,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> runs until the connection ends
        (for example, when the server exits) or
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> is forcibly terminated. When the
        connection ends, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> does not wait
        and retry the connection, unlike a slave replication server. To
        continue a live backup after the server has been restarted, you
        must also restart <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>.
</p>
<div class="important" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Important
</div>
<p>
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> can back up both encrypted and
          unencrypted binary log files . However, copies of encrypted
          binary log files that are generated using
          <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> are stored in an unencrypted
          format.
</p>
</div>
<h5><a name="mysqlbinlog-backup-options"></a>mysqlbinlog Backup Options</h5>
<p>
        Binary log backup requires that you invoke
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> with two options at minimum:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The
            <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
            (or <code class="option">-R</code>) option tells
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to connect to a server and
            request its binary log. (This is similar to a slave
            replication server connecting to its master server.)
          </p></li><li class="listitem"><p>
            The <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a> option tells
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to write raw (binary) output,
            not text output.
</p></li></ul>
</div>
<p>
        Along with
        <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>,
        it is common to specify other options:
        <a class="link" href="programs.html#option_mysqlbinlog_host"><code class="option">--host</code></a> indicates where the
        server is running, and you may also need to specify connection
        options such as <a class="link" href="programs.html#option_mysqlbinlog_user"><code class="option">--user</code></a> and
        <a class="link" href="programs.html#option_mysqlbinlog_password"><code class="option">--password</code></a>.
      </p><p>
        Several other options are useful in conjunction with
        <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a>: Stay
            connected to the server after reaching the end of the last
            log file and continue to read new events.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id=<em class="replaceable"><code>id</code></em></code></a>:
            The server ID that <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reports
            when it connects to a server. When
            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a> is used,
            the default reported server ID is 1. If this causes a
            conflict with the ID of a slave server or another
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> process, use
            <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id</code></a>
            to specify an alternative server ID. See
            <a class="xref" href="programs.html#mysqlbinlog-server-id" title="4.6.8.4 Specifying the mysqlbinlog Server ID">Section 4.6.8.4, “Specifying the mysqlbinlog Server ID”</a>.
          </p></li><li class="listitem"><p>
            <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a>: A prefix
            for output file names, as described later.
</p></li></ul>
</div>
<h5><a name="mysqlbinlog-backup-static-live"></a>Static and Live Backups</h5>
<p>
        To back up a server's binary log files with
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a>, you must specify file names that
        actually exist on the server. If you do not know the names,
        connect to the server and use the <a class="link" href="sql-statements.html#show-binary-logs" title="13.7.7.1 SHOW BINARY LOGS Statement"><code class="literal">SHOW
        BINARY LOGS</code></a> statement to see the current names.
        Suppose that the statement produces this output:
      </p><pre data-lang="sql" class="programlisting">mysql&gt; <strong class="userinput"><code>SHOW BINARY LOGS;</code></strong>
+---------------+-----------+-----------+
| Log_name      | File_size | Encrypted |
+---------------+-----------+-----------+
| binlog.000130 |     27459 | No        |
| binlog.000131 |     13719 | No        |
| binlog.000132 |     43268 | No        |
+---------------+-----------+-----------+
</pre><p>
        With that information, you can use
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to back up the binary log to the
        current directory as follows (enter each command on a single
        line):
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            To make a static backup of
            <code class="filename">binlog.000130</code> through
            <code class="filename">binlog.000132</code>, use either of these
            commands:
          </p><pre data-lang="terminal" class="programlisting">mysqlbinlog --read-from-remote-server --host=<em class="replaceable"><code>host_name</code></em> --raw
  binlog.000130 binlog.000131 binlog.000132

mysqlbinlog --read-from-remote-server --host=<em class="replaceable"><code>host_name</code></em> --raw
  --to-last-log binlog.000130
</pre><p>
            The first command specifies every file name explicitly. The
            second names only the first file and uses
            <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a> to read
            through the last. A difference between these commands is
            that if the server happens to open
            <code class="filename">binlog.000133</code> before
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> reaches the end of
            <code class="filename">binlog.000132</code>, the first command will
            not read it, but the second command will.
          </p></li><li class="listitem"><p>
            To make a live backup in which
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> starts with
            <code class="filename">binlog.000130</code> to copy existing log
            files, then stays connected to copy new events as the server
            generates them:
          </p><pre data-lang="terminal" class="programlisting">mysqlbinlog --read-from-remote-server --host=<em class="replaceable"><code>host_name</code></em> --raw
  --stop-never binlog.000130
</pre><p>
            With <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a>, it is
            not necessary to specify
            <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a> to read to
            the last log file because that option is implied.
</p></li></ul>
</div>
<h5><a name="mysqlbinlog-backup-output-file-naming"></a>Output File Naming</h5>
<p>
        Without <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> produces text output and the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> option, if
        given, specifies the name of the single file to which all output
        is written. With <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes one binary output file for
        each log file transferred from the server. By default,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> writes the files in the current
        directory with the same names as the original log files. To
        modify the output file names, use the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> option. In
        conjunction with <a class="link" href="programs.html#option_mysqlbinlog_raw"><code class="option">--raw</code></a>, the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> option value
        is treated as a prefix that modifies the output file names.
      </p><p>
        Suppose that a server currently has binary log files named
        <code class="filename">binlog.000999</code> and up. If you use
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog --raw</strong></span></a> to back up the files, the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> option
        produces output file names as shown in the following table. You
        can write the files to a specific directory by beginning the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> value with the
        directory path. If the
        <a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> value consists
        only of a directory name, the value must end with the pathname
        separator character. Output files are overwritten if they exist.
</p>
<div class="informaltable">
<table summary="mysqlbinlog --result-file options and corresponding output file names, as described in the example in the preceding text."><col width="50%"><col width="50%"><thead><tr>
            <th scope="col"><a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file</code></a> Option</th>
            <th scope="col">Output File Names</th>
          </tr></thead><tbody><tr>
            <td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file=x</code></a></td>
            <td><code class="filename">xbinlog.000999</code> and up</td>
          </tr><tr>
            <td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file=/tmp/</code></a></td>
            <td><code class="filename">/tmp/binlog.000999</code> and up</td>
          </tr><tr>
            <td scope="row"><a class="link" href="programs.html#option_mysqlbinlog_result-file"><code class="option">--result-file=/tmp/x</code></a></td>
            <td><code class="filename">/tmp/xbinlog.000999</code> and up</td>
</tr></tbody></table>
</div>
<h5><a name="mysqlbinlog-backup-example"></a>Example: mysqldump + mysqlbinlog for Backup and Restore</h5>
<p>
        The following example describes a simple scenario that shows how
        to use <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> and
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> together to back up a server's
        data and binary log, and how to use the backup to restore the
        server if data loss occurs. The example assumes that the server
        is running on host <em class="replaceable"><code>host_name</code></em> and its
        first binary log file is named
        <code class="filename">binlog.000999</code>. Enter each command on a
        single line.
      </p><p>
        Use <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to make a continuous backup
        of the binary log:
      </p><pre data-lang="terminal" class="programlisting">mysqlbinlog --read-from-remote-server --host=<em class="replaceable"><code>host_name</code></em> --raw
  --stop-never binlog.000999
</pre><p>
        Use <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> to create a dump file as a
        snapshot of the server's data. Use
        <a class="link" href="programs.html#option_mysqldump_all-databases"><code class="option">--all-databases</code></a>,
        <a class="link" href="programs.html#option_mysqldump_events"><code class="option">--events</code></a>, and
        <a class="link" href="programs.html#option_mysqldump_routines"><code class="option">--routines</code></a> to back up all
        data, and <a class="link" href="programs.html#option_mysqldump_master-data"><code class="option">--master-data=2</code></a> to
        include the current binary log coordinates in the dump file.
      </p><pre data-lang="terminal" class="programlisting">mysqldump --host=<em class="replaceable"><code>host_name</code></em> --all-databases --events --routines --master-data=2&gt; <em class="replaceable"><code>dump_file</code></em>
</pre><p>
        Execute the <a class="link" href="programs.html#mysqldump" title="4.5.4 mysqldump — A Database Backup Program"><span class="command"><strong>mysqldump</strong></span></a> command periodically to
        create newer snapshots as desired.
      </p><p>
        If data loss occurs (for example, if the server crashes), use
        the most recent dump file to restore the data:
      </p><pre data-lang="terminal" class="programlisting">mysql --host=<em class="replaceable"><code>host_name</code></em> -u root -p &lt; <em class="replaceable"><code>dump_file</code></em>
</pre><p>
        Then use the binary log backup to re-execute events that were
        written after the coordinates listed in the dump file. Suppose
        that the coordinates in the file look like this:
      </p><pre data-lang="none" class="programlisting">-- CHANGE MASTER TO MASTER_LOG_FILE='binlog.001002', MASTER_LOG_POS=27284;</pre><p>
        If the most recent backed-up log file is named
        <code class="filename">binlog.001004</code>, re-execute the log events
        like this:
      </p><pre data-lang="terminal" class="programlisting">mysqlbinlog --start-position=27284 binlog.001002 binlog.001003 binlog.001004
  | mysql --host=<em class="replaceable"><code>host_name</code></em> -u root -p
</pre><p>
        You might find it easier to copy the backup files (dump file and
        binary log files) to the server host to make it easier to
        perform the restore operation, or if MySQL does not allow remote
        <code class="literal">root</code> access.
</p>
<h5><a name="mysqlbinlog-backup-restrictions"></a>mysqlbinlog Backup Restrictions</h5>
<p>
        Binary log backups with <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> are
        subject to these restrictions:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> does not automatically
            reconnect to the MySQL server if the connection is lost (for
            example, if a server restart occurs or there is a network
            outage).
          </p></li><li class="listitem"><p>
            The delay for a backup is similar to the delay for a
            replication slave.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="mysqlbinlog-server-id"></a>4.6.8.4 Specifying the mysqlbinlog Server ID</h4>

</div>

</div>

</div>
<p>
        When invoked with the <code class="option">--read-from-remote-server</code>
        option, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> connects to a MySQL
        server, specifies a server ID to identify itself, and requests
        binary log files from the server. You can use
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> to request log files from a
        server in several ways:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            Specify an explicitly named set of files: For each file,
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> connects and issues a
            <code class="literal">Binlog dump</code> command. The server sends the
            file and disconnects. There is one connection per file.
          </p></li><li class="listitem"><p>
            Specify the beginning file and
            <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a>:
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> connects and issues a
            <code class="literal">Binlog dump</code> command for all files. The
            server sends all files and disconnects.
          </p></li><li class="listitem"><p>
            Specify the beginning file and
            <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a> (which
            implies <a class="link" href="programs.html#option_mysqlbinlog_to-last-log"><code class="option">--to-last-log</code></a>):
            <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> connects and issues a
            <code class="literal">Binlog dump</code> command for all files. The
            server sends all files, but does not disconnect after
            sending the last one.
</p></li></ul>
</div>
<p>
        With
        <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
        only, <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> connects using a server ID
        of 0, which tells the server to disconnect after sending the
        last requested log file.
      </p><p>
        With
        <a class="link" href="programs.html#option_mysqlbinlog_read-from-remote-server"><code class="option">--read-from-remote-server</code></a>
        and <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a>,
        <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> connects using a nonzero server
        ID, so the server does not disconnect after sending the last log
        file. The server ID is 1 by default, but this can be changed
        with <a class="link" href="programs.html#option_mysqlbinlog_connection-server-id"><code class="option">--connection-server-id</code></a>.
      </p><p>
        Thus, for the first two ways of requesting files, the server
        disconnects because <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> specifies a
        server ID of 0. It does not disconnect if
        <a class="link" href="programs.html#option_mysqlbinlog_stop-never"><code class="option">--stop-never</code></a> is given
        because <a class="link" href="programs.html#mysqlbinlog" title="4.6.8 mysqlbinlog — Utility for Processing Binary Log Files"><span class="command"><strong>mysqlbinlog</strong></span></a> specifies a nonzero
        server ID.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysqldumpslow"></a>4.6.9 <span class="command"><strong>mysqldumpslow</strong></span> — Summarize Slow Query Log Files</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444418274992"></a><p>
        The MySQL slow query log contains information about queries that
        take a long time to execute (see
        <a class="xref" href="server-administration.html#slow-query-log" title="5.4.5 The Slow Query Log">Section 5.4.5, “The Slow Query Log”</a>).
        <a class="link" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files"><span class="command"><strong>mysqldumpslow</strong></span></a> parses MySQL slow query log
        files and summarizes their contents.
      </p><p>
        Normally, <a class="link" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files"><span class="command"><strong>mysqldumpslow</strong></span></a> groups queries that
        are similar except for the particular values of number and
        string data values. It <span class="quote">“<span class="quote">abstracts</span>”</span> these values to
        <code class="literal">N</code> and <code class="literal">'S'</code> when displaying
        summary output. To modify value abstracting behavior, use the
        <code class="option">-a</code> and <code class="option">-n</code> options.
      </p><p>
        Invoke <a class="link" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files"><span class="command"><strong>mysqldumpslow</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldumpslow [<em class="replaceable"><code>options</code></em>] [<em class="replaceable"><code>log_file</code></em> ...]</code></strong>
</pre><p>
        Example of usage:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqldumpslow</code></strong>

Reading mysql slow query log from /usr/local/mysql/data/mysqld80-slow.log
Count: 1  Time=4.32s (4s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost
 insert into t2 select * from t1

Count: 3  Time=2.53s (7s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost
 insert into t2 select * from t1 limit N

Count: 3  Time=2.13s (6s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost
 insert into t1 select * from t1
</pre><p>
        <a class="link" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files"><span class="command"><strong>mysqldumpslow</strong></span></a> supports the following options.
</p>
<div class="table">
<a name="idm46444418258576"></a><p class="title"><b>Table 4.22 mysqldumpslow Options</b></p>
<div class="table-contents">
<table frame="box" rules="all" summary="Command-line options available for mysqldumpslow."><col width="35%"><col width="64%"><thead><tr><th scope="col">Option Name</th>
<th scope="col">Description</th>
</tr></thead><tbody><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_abstract">-a</a></td>
<td>Do not abstract all numbers to N and strings to 'S'</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_abstract-numbers">-n</a></td>
<td>Abstract numbers with at least the specified digits</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_debug">--debug</a></td>
<td>Write debugging information</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_grep">-g</a></td>
<td>Only consider statements that match the pattern</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_help">--help</a></td>
<td>Display help message and exit</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_host">-h</a></td>
<td>Host name of the server in the log file name</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_instance">-i</a></td>
<td>Name of the server instance</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_lock">-l</a></td>
<td>Do not subtract lock time from total time</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_reverse">-r</a></td>
<td>Reverse the sort order</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_sort">-s</a></td>
<td>How to sort output</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_top">-t</a></td>
<td>Display only first num queries</td>
</tr><tr><td scope="row"><a class="link" href="programs.html#option_mysqldumpslow_verbose">--verbose</a></td>
<td>Verbose mode</td>
</tr></tbody></table>
</div>

</div>
<br class="table-break">
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysqldumpslow_help"></a>
            <a class="indexterm" name="idm46444418215072"></a>

            <a class="indexterm" name="idm46444418213584"></a>

            <a class="link" href="programs.html#option_mysqldumpslow_help"><code class="option">--help</code></a>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_abstract"></a>
            <code class="option">-a</code>
          </p><p>
            Do not abstract all numbers to <code class="literal">N</code> and
            strings to <code class="literal">'S'</code>.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_debug"></a>
            <a class="indexterm" name="idm46444418206048"></a>

            <a class="indexterm" name="idm46444418204560"></a>

            <a class="link" href="programs.html#option_mysqldumpslow_debug"><code class="option">--debug</code></a>,
            <code class="option">-d</code>
          </p><p>
            Run in debug mode.
          </p><p>
            This option is available only if MySQL was built using
            <a class="link" href="installing.html#option_cmake_with_debug"><code class="option">WITH_DEBUG</code></a>. MySQL release
            binaries provided by Oracle are <span class="emphasis"><em>not</em></span>
            built using this option.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_grep"></a>
            <code class="option">-g <em class="replaceable"><code>pattern</code></em></code>
          </p><p>
            Consider only queries that match the
            (<span class="command"><strong>grep</strong></span>-style) pattern.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_host"></a>
            <code class="option">-h <em class="replaceable"><code>host_name</code></em></code>
          </p><p>
            Host name of MySQL server for
            <code class="filename">*-slow.log</code> file name. The value can
            contain a wildcard. The default is <code class="literal">*</code>
            (match all).
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_instance"></a>
            <code class="option">-i <em class="replaceable"><code>name</code></em></code>
          </p><p>
            Name of server instance (if using
            <a class="link" href="programs.html#mysql-server" title="4.3.3 mysql.server — MySQL Server Startup Script"><span class="command"><strong>mysql.server</strong></span></a> startup script).
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_lock"></a>
            <code class="option">-l</code>
          </p><p>
            Do not subtract lock time from total time.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_abstract-numbers"></a>
            <code class="option">-n <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Abstract numbers with at least <em class="replaceable"><code>N</code></em>
            digits within names.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_reverse"></a>
            <code class="option">-r</code>
          </p><p>
            Reverse the sort order.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_sort"></a>
            <code class="option">-s <em class="replaceable"><code>sort_type</code></em></code>
          </p><p>
            How to sort the output. The value of
            <em class="replaceable"><code>sort_type</code></em> should be chosen from
            the following list:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                <code class="literal">t</code>, <code class="literal">at</code>: Sort by
                query time or average query time
              </p></li><li class="listitem"><p>
                <code class="literal">l</code>, <code class="literal">al</code>: Sort by
                lock time or average lock time
              </p></li><li class="listitem"><p>
                <code class="literal">r</code>, <code class="literal">ar</code>: Sort by
                rows sent or average rows sent
              </p></li><li class="listitem"><p>
                <code class="literal">c</code>: Sort by count
</p></li></ul>
</div>
<p>
            By default, <a class="link" href="programs.html#mysqldumpslow" title="4.6.9 mysqldumpslow — Summarize Slow Query Log Files"><span class="command"><strong>mysqldumpslow</strong></span></a> sorts by
            average query time (equivalent to <code class="option">-s at</code>).
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_top"></a>
            <code class="option">-t <em class="replaceable"><code>N</code></em></code>
          </p><p>
            Display only the first <em class="replaceable"><code>N</code></em> queries
            in the output.
          </p></li><li class="listitem"><p><a name="option_mysqldumpslow_verbose"></a>
            <a class="indexterm" name="idm46444418164560"></a>

            <a class="indexterm" name="idm46444418163072"></a>

            <a class="link" href="programs.html#option_mysqldumpslow_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-development"></a>4.7 Program Development Utilities</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#mysql-config">4.7.1 <span class="command"><strong>mysql_config</strong></span> — Display Options for Compiling Clients</a></span></dt><dt><span class="section"><a href="programs.html#my-print-defaults">4.7.2 <span class="command"><strong>my_print_defaults</strong></span> — Display Options from Option Files</a></span></dt></dl>
</div>
<p>
    This section describes some utilities that you may find useful when
    developing MySQL programs.
  </p><p>
    In shell scripts, you can use the
    <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a> program to parse option files
    and see what options would be used by a given program. The following
    example shows the output that <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a>
    might produce when asked to show the options found in the
    <code class="literal">[client]</code> and <code class="literal">[mysql]</code> groups:
  </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>my_print_defaults client mysql</code></strong>
--port=3306
--socket=/tmp/mysql.sock
--no-auto-rehash
</pre><p>
    Note for developers: Option file handling is implemented in the C
    client library simply by processing all options in the appropriate
    group or groups before any command-line arguments. This works well
    for programs that use the last instance of an option that is
    specified multiple times. If you have a C or C++ program that
    handles multiply specified options this way but that doesn't read
    option files, you need add only two lines to give it that
    capability. Check the source code of any of the standard MySQL
    clients to see how to do this.
  </p><p>
    Several other language interfaces to MySQL are based on the C client
    library, and some of them provide a way to access option file
    contents. These include Perl and Python. For details, see the
    documentation for your preferred interface.
</p>
<div class="section">

<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="mysql-config"></a>4.7.1 <span class="command"><strong>mysql_config</strong></span> — Display Options for Compiling Clients</h3>
</div>
</div>
</div>
<a class="indexterm" name="idm46444418148016"></a><a class="indexterm" name="idm46444418147072"></a><p>
        <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> provides you with useful
        information for compiling your MySQL client and connecting it to
        MySQL. It is a shell script, so it is available only on Unix and
        Unix-like systems.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          <span class="command"><strong>pkg-config</strong></span> can be used as an alternative to
          <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> for obtaining information such
          as compiler flags or link libraries required to compile MySQL
          applications. For more information, see
          <a class="xref" href="connectors-apis.html#c-api-building-clients-pkg-config" title="28.7.3.2 Building C API Client Programs Using pkg-config">Section 28.7.3.2, “Building C API Client Programs Using pkg-config”</a>.
</p>
</div>
<p>
        <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> supports the following options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_mysql_config_cflags"></a>
            <a class="indexterm" name="idm46444418137568"></a>

            <a class="indexterm" name="idm46444418136080"></a>

            <a class="link" href="programs.html#option_mysql_config_cflags"><code class="option">--cflags</code></a>
          </p><p>
            C Compiler flags to find include files and critical compiler
            flags and defines used when compiling the
            <code class="literal">libmysqlclient</code> library. The options
            returned are tied to the specific compiler that was used
            when the library was created and might clash with the
            settings for your own compiler. Use
            <a class="link" href="programs.html#option_mysql_config_include"><code class="option">--include</code></a> for more
            portable options that contain only include paths.
          </p></li><li class="listitem"><p><a name="option_mysql_config_cxxflags"></a>
            <a class="indexterm" name="idm46444418129760"></a>

            <a class="indexterm" name="idm46444418128272"></a>

            <a class="link" href="programs.html#option_mysql_config_cxxflags"><code class="option">--cxxflags</code></a>
          </p><p>
            Like <a class="link" href="programs.html#option_mysql_config_cflags"><code class="option">--cflags</code></a>, but for
            C++ compiler flags.
          </p></li><li class="listitem"><p><a name="option_mysql_config_include"></a>
            <a class="indexterm" name="idm46444418123216"></a>

            <a class="indexterm" name="idm46444418121728"></a>

            <a class="link" href="programs.html#option_mysql_config_include"><code class="option">--include</code></a>
          </p><p>
            Compiler options to find MySQL include files.
          </p></li><li class="listitem"><p><a name="option_mysql_config_libs"></a>
            <a class="indexterm" name="idm46444418117600"></a>

            <a class="indexterm" name="idm46444418116112"></a>

            <a class="link" href="programs.html#option_mysql_config_libs"><code class="option">--libs</code></a>
          </p><p>
            Libraries and options required to link with the MySQL client
            library.
          </p></li><li class="listitem"><p><a name="option_mysql_config_libs_r"></a>
            <a class="indexterm" name="idm46444418111856"></a>

            <a class="indexterm" name="idm46444418110368"></a>

            <a class="link" href="programs.html#option_mysql_config_libs_r"><code class="option">--libs_r</code></a>
          </p><p>
            Libraries and options required to link with the thread-safe
            MySQL client library. In MySQL 8.0, all client
            libraries are thread-safe, so this option need not be used.
            The <a class="link" href="programs.html#option_mysql_config_libs"><code class="option">--libs</code></a> option can
            be used in all cases.
          </p></li><li class="listitem"><p><a name="option_mysql_config_plugindir"></a>
            <a class="indexterm" name="idm46444418104912"></a>

            <a class="indexterm" name="idm46444418103424"></a>

            <a class="link" href="programs.html#option_mysql_config_plugindir"><code class="option">--plugindir</code></a>
          </p><p>
            The default plugin directory path name, defined when
            configuring MySQL.
          </p></li><li class="listitem"><p><a name="option_mysql_config_port"></a>
            <a class="indexterm" name="idm46444418099120"></a>

            <a class="indexterm" name="idm46444418097632"></a>

            <a class="indexterm" name="idm46444418096144"></a>

            <a class="link" href="programs.html#option_mysql_config_port"><code class="option">--port</code></a>
          </p><p>
            The default TCP/IP port number, defined when configuring
            MySQL.
          </p></li><li class="listitem"><p><a name="option_mysql_config_socket"></a>
            <a class="indexterm" name="idm46444418092336"></a>

            <a class="indexterm" name="idm46444418090848"></a>

            <a class="link" href="programs.html#option_mysql_config_socket"><code class="option">--socket</code></a>
          </p><p>
            The default Unix socket file, defined when configuring
            MySQL.
          </p></li><li class="listitem"><p><a name="option_mysql_config_variable"></a>
            <a class="indexterm" name="idm46444418086608"></a>

            <a class="indexterm" name="idm46444418085120"></a>

            <a class="link" href="programs.html#option_mysql_config_variable"><code class="option">--variable=<em class="replaceable"><code>var_name</code></em></code></a>
          </p><p>
            Display the value of the named configuration variable.
            Permitted <em class="replaceable"><code>var_name</code></em> values are
            <code class="literal">pkgincludedir</code> (the header file
            directory), <code class="literal">pkglibdir</code> (the library
            directory), and <code class="literal">plugindir</code> (the plugin
            directory).
          </p></li><li class="listitem"><p><a name="option_mysql_config_version"></a>
            <a class="indexterm" name="idm46444418077888"></a>

            <a class="indexterm" name="idm46444418076400"></a>

            <a class="link" href="programs.html#option_mysql_config_version"><code class="option">--version</code></a>
          </p><p>
            Version number for the MySQL distribution.
</p></li></ul>
</div>
<p>
        If you invoke <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> with no options,
        it displays a list of all options that it supports, and their
        values:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysql_config</code></strong>
Usage: /usr/local/mysql/bin/mysql_config [options]
Options:
  --cflags         [-I/usr/local/mysql/include/mysql -mcpu=pentiumpro]
  --cxxflags       [-I/usr/local/mysql/include/mysql -mcpu=pentiumpro]
  --include        [-I/usr/local/mysql/include/mysql]
  --libs           [-L/usr/local/mysql/lib/mysql -lmysqlclient
                    -lpthread -lm -lrt -lssl -lcrypto -ldl]
  --libs_r         [-L/usr/local/mysql/lib/mysql -lmysqlclient_r
                    -lpthread -lm -lrt -lssl -lcrypto -ldl]
  --plugindir      [/usr/local/mysql/lib/plugin]
  --socket         [/tmp/mysql.sock]
  --port           [3306]
  --version        [5.8.0-m17]
  --variable=VAR   VAR is one of:
          pkgincludedir [/usr/local/mysql/include]
          pkglibdir     [/usr/local/mysql/lib]
          plugindir     [/usr/local/mysql/lib/plugin]
</pre><p>
        You can use <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> within a command
        line using backticks to include the output that it produces for
        particular options. For example, to compile and link a MySQL
        client program, use <a class="link" href="programs.html#mysql-config" title="4.7.1 mysql_config — Display Options for Compiling Clients"><span class="command"><strong>mysql_config</strong></span></a> as follows:
      </p><pre data-lang="terminal" class="programlisting">gcc -c `mysql_config --cflags` progname.c
gcc -o progname progname.o `mysql_config --libs`</pre>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="my-print-defaults"></a>4.7.2 <span class="command"><strong>my_print_defaults</strong></span> — Display Options from Option Files</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444418062256"></a><p>
        <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a> displays the options that
        are present in option groups of option files. The output
        indicates what options will be used by programs that read the
        specified option groups. For example, the
        <a class="link" href="programs.html#mysqlcheck" title="4.5.3 mysqlcheck — A Table Maintenance Program"><span class="command"><strong>mysqlcheck</strong></span></a> program reads the
        <code class="literal">[mysqlcheck]</code> and <code class="literal">[client]</code>
        option groups. To see what options are present in those groups
        in the standard option files, invoke
        <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>my_print_defaults mysqlcheck client</code></strong>
--user=myusername
--password=<em class="replaceable"><code>password</code></em>
--host=localhost
</pre><p>
        The output consists of options, one per line, in the form that
        they would be specified on the command line.
      </p><p>
        <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a> supports the following
        options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_my_print_defaults_help"></a>
            <a class="indexterm" name="idm46444418049664"></a>

            <a class="indexterm" name="idm46444418048176"></a>

            <a class="link" href="programs.html#option_my_print_defaults_help"><code class="option">--help</code></a>,
            <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_config-file"></a>
            <a class="indexterm" name="idm46444418043616"></a>

            <a class="indexterm" name="idm46444418042128"></a>

            <a class="link" href="programs.html#option_my_print_defaults_config-file"><code class="option">--config-file=<em class="replaceable"><code>file_name</code></em></code></a>,

            <a class="indexterm" name="idm46444418039232"></a>

            <a class="indexterm" name="idm46444418037744"></a>

            <a class="link" href="programs.html#option_my_print_defaults_config-file"><code class="option">--defaults-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-c <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            Read only the given option file.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_debug"></a>
            <a class="indexterm" name="idm46444418032608"></a>

            <a class="indexterm" name="idm46444418031120"></a>

            <a class="link" href="programs.html#option_my_print_defaults_debug"><code class="option">--debug=<em class="replaceable"><code>debug_options</code></em></code></a>,
            <code class="option">-# <em class="replaceable"><code>debug_options</code></em></code>
          </p><p>
            Write a debugging log. A typical
            <em class="replaceable"><code>debug_options</code></em> string is
            <code class="literal">d:t:o,<em class="replaceable"><code>file_name</code></em></code>.
            The default is
            <code class="literal">d:t:o,/tmp/my_print_defaults.trace</code>.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_defaults-extra-file"></a>
            <a class="indexterm" name="idm46444418023536"></a>

            <a class="indexterm" name="idm46444418022032"></a>

            <a class="link" href="programs.html#option_my_print_defaults_defaults-extra-file"><code class="option">--defaults-extra-file=<em class="replaceable"><code>file_name</code></em></code></a>,

            <a class="indexterm" name="idm46444418019152"></a>

            <a class="indexterm" name="idm46444418017664"></a>

            <a class="link" href="programs.html#option_my_print_defaults_defaults-extra-file"><code class="option">--extra-file=<em class="replaceable"><code>file_name</code></em></code></a>,
            <code class="option">-e <em class="replaceable"><code>file_name</code></em></code>
          </p><p>
            Read this option file after the global option file but (on
            Unix) before the user option file.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_defaults-group-suffix"></a>
            <a class="indexterm" name="idm46444418011184"></a>

            <a class="indexterm" name="idm46444418009680"></a>

            <a class="link" href="programs.html#option_my_print_defaults_defaults-group-suffix"><code class="option">--defaults-group-suffix=<em class="replaceable"><code>suffix</code></em></code></a>,
            <code class="option">-g <em class="replaceable"><code>suffix</code></em></code>
          </p><p>
            In addition to the groups named on the command line, read
            groups that have the given suffix.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_login-path"></a>
            <a class="indexterm" name="idm46444418003152"></a>

            <a class="link" href="programs.html#option_my_print_defaults_login-path"><code class="option">--login-path=<em class="replaceable"><code>name</code></em></code></a>,
            <code class="option">-l <em class="replaceable"><code>name</code></em></code>
          </p><p>
            Read options from the named login path in the
            <code class="filename">.mylogin.cnf</code> login path file. A
            <span class="quote">“<span class="quote">login path</span>”</span> is an option group containing
            options that specify which MySQL server to connect to and
            which account to authenticate as. To create or modify a
            login path file, use the
            <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a> utility. See
            <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_no-defaults"></a>
            <a class="indexterm" name="idm46444417993776"></a>

            <a class="indexterm" name="idm46444417992288"></a>

            <a class="link" href="programs.html#option_my_print_defaults_no-defaults"><code class="option">--no-defaults</code></a>,
            <code class="option">-n</code>
          </p><p>
            Return an empty string.
          </p><p>
            For additional information about this and other option-file
            options, see <a class="xref" href="programs.html#option-file-options" title="4.2.2.3 Command-Line Options that Affect Option-File Handling">Section 4.2.2.3, “Command-Line Options that Affect Option-File Handling”</a>.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_show"></a>
            <a class="indexterm" name="idm46444417986528"></a>

            <a class="indexterm" name="idm46444417985040"></a>

            <a class="link" href="programs.html#option_my_print_defaults_show"><code class="option">--show</code></a>,
            <code class="option">-s</code>
          </p><p>
            <a class="link" href="programs.html#my-print-defaults" title="4.7.2 my_print_defaults — Display Options from Option Files"><span class="command"><strong>my_print_defaults</strong></span></a> masks passwords by
            default. Use this option to display passwords as cleartext.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_verbose"></a>
            <a class="indexterm" name="idm46444417979200"></a>

            <a class="indexterm" name="idm46444417977712"></a>

            <a class="link" href="programs.html#option_my_print_defaults_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print more information about what the program
            does.
          </p></li><li class="listitem"><p><a name="option_my_print_defaults_version"></a>
            <a class="indexterm" name="idm46444417973008"></a>

            <a class="indexterm" name="idm46444417971520"></a>

            <a class="link" href="programs.html#option_my_print_defaults_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>

</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="programs-miscellaneous"></a>4.8 Miscellaneous Programs</h2>

</div>

</div>

</div>
<div class="toc">
<dl class="toc"><dt><span class="section"><a href="programs.html#lz4-decompress">4.8.1 <span class="command"><strong>lz4_decompress</strong></span> — Decompress mysqlpump LZ4-Compressed Output</a></span></dt><dt><span class="section"><a href="programs.html#perror">4.8.2 <span class="command"><strong>perror</strong></span> — Display MySQL Error Message Information</a></span></dt><dt><span class="section"><a href="programs.html#zlib-decompress">4.8.3 <span class="command"><strong>zlib_decompress</strong></span> — Decompress mysqlpump ZLIB-Compressed Output</a></span></dt></dl>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="lz4-decompress"></a>4.8.1 <span class="command"><strong>lz4_decompress</strong></span> — Decompress mysqlpump LZ4-Compressed Output</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417964832"></a><p>
        The <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a> utility decompresses
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> output that was created using LZ4
        compression.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          If MySQL was configured with the
          <a class="link" href="installing.html#option_cmake_with_lz4"><code class="option">-DWITH_LZ4=system</code></a> option,
          <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a> is not built. In this case,
          the system <span class="command"><strong>lz4</strong></span> command can be used instead.
</p>
</div>
<p>
        Invoke <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>lz4_decompress <em class="replaceable"><code>input_file</code></em> <em class="replaceable"><code>output_file</code></em></code></strong>
</pre><p>
        Example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --compress-output=LZ4 &gt; dump.lz4</code></strong>
shell&gt; <strong class="userinput"><code>lz4_decompress dump.lz4 dump.txt</code></strong>
</pre><p>
        To see a help message, invoke <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a>
        with no arguments.
      </p><p>
        To decompress <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> ZLIB-compressed
        output, use <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a>. See
        <a class="xref" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output">Section 4.8.3, “<span class="command"><strong>zlib_decompress</strong></span> — Decompress mysqlpump ZLIB-Compressed Output”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="perror"></a>4.8.2 <span class="command"><strong>perror</strong></span> — Display MySQL Error Message Information</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417943264"></a><a class="indexterm" name="idm46444417942320"></a><a class="indexterm" name="idm46444417940960"></a><a class="indexterm" name="idm46444417940016"></a><p>
        <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a> displays the error message for MySQL
        or operating system error codes. Invoke
        <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>perror [<em class="replaceable"><code>options</code></em>] <em class="replaceable"><code>errorcode</code></em> ...</code></strong>
</pre><p>
        <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a> attempts to be flexible in
        understanding its arguments. For example, for the
        <a class="link" href="error-handling.html#error_er_wrong_value_for_var"><code class="literal">ER_WRONG_VALUE_FOR_VAR</code></a> error,
        <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a> understands any of these arguments:
        <code class="option">1231</code>, <code class="literal">001231</code>,
        <code class="literal">MY-1231</code>, or <code class="literal">MY-001231</code>, or
        <a class="link" href="error-handling.html#error_er_wrong_value_for_var"><code class="literal">ER_WRONG_VALUE_FOR_VAR</code></a>.
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>perror 1231</code></strong>
MySQL error code MY-001231 (ER_WRONG_VALUE_FOR_VAR): Variable '%-.64s'
can't be set to the value of '%-.200s'
</pre><p>
        If an error number is in the range where MySQL and operating
        system errors overlap, <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a> displays both
        error messages:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>perror 1 13</code></strong>
OS error code   1:  Operation not permitted
MySQL error code MY-000001: Can't create/write to file '%s' (OS errno %d - %s)
OS error code  13:  Permission denied
MySQL error code MY-000013: Can't get stat of '%s' (OS errno %d - %s)
</pre><p>
        To obtain the error message for a MySQL Cluster error code, use
        the <a class="link" href="mysql-cluster.html#mysql-cluster-programs-ndb-perror" title="22.4.16 ndb_perror — Obtain NDB Error Message Information"><span class="command"><strong>ndb_perror</strong></span></a> utility.
      </p><p>
        The meaning of system error messages may be dependent on your
        operating system. A given error code may mean different things
        on different operating systems.
      </p><p>
        <a class="link" href="programs.html#perror" title="4.8.2 perror — Display MySQL Error Message Information"><span class="command"><strong>perror</strong></span></a> supports the following options.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a name="option_perror_help"></a>
            <a class="indexterm" name="idm46444417914640"></a>

            <a class="indexterm" name="idm46444417913184"></a>

            <a class="link" href="programs.html#option_perror_help"><code class="option">--help</code></a>,
            <a class="link" href="programs.html#option_perror_help"><code class="option">--info</code></a>,
            <code class="option">-I</code>, <code class="option">-?</code>
          </p><p>
            Display a help message and exit.
          </p></li><li class="listitem"><p><a name="option_perror_ndb"></a>
            <a class="indexterm" name="idm46444417907264"></a>

            <a class="indexterm" name="idm46444417905808"></a>

            <a class="link" href="programs.html#option_perror_ndb"><code class="option">--ndb</code></a>
          </p><p>
            Print the error message for a MySQL Cluster error code.
          </p><p>
            This option was removed in MySQL 8.0.13. Use the
            <a class="link" href="mysql-cluster.html#mysql-cluster-programs-ndb-perror" title="22.4.16 ndb_perror — Obtain NDB Error Message Information"><span class="command"><strong>ndb_perror</strong></span></a> utility instead.
          </p></li><li class="listitem"><p><a name="option_perror_silent"></a>
            <a class="indexterm" name="idm46444417899744"></a>

            <a class="indexterm" name="idm46444417898288"></a>

            <a class="link" href="programs.html#option_perror_silent"><code class="option">--silent</code></a>, <code class="option">-s</code>
          </p><p>
            Silent mode. Print only the error message.
          </p></li><li class="listitem"><p><a name="option_perror_verbose"></a>
            <a class="indexterm" name="idm46444417893680"></a>

            <a class="indexterm" name="idm46444417892224"></a>

            <a class="link" href="programs.html#option_perror_verbose"><code class="option">--verbose</code></a>,
            <code class="option">-v</code>
          </p><p>
            Verbose mode. Print error code and message. This is the
            default behavior.
          </p></li><li class="listitem"><p><a name="option_perror_version"></a>
            <a class="indexterm" name="idm46444417887520"></a>

            <a class="indexterm" name="idm46444417886064"></a>

            <a class="link" href="programs.html#option_perror_version"><code class="option">--version</code></a>,
            <code class="option">-V</code>
          </p><p>
            Display version information and exit.
</p></li></ul>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="zlib-decompress"></a>4.8.3 <span class="command"><strong>zlib_decompress</strong></span> — Decompress mysqlpump ZLIB-Compressed Output</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417880576"></a><p>
        The <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a> utility decompresses
        <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> output that was created using ZLIB
        compression.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">

<div class="admon-title">
Note
</div>
<p>
          If MySQL was configured with the
          <a class="link" href="installing.html#option_cmake_with_zlib"><code class="option">-DWITH_ZLIB=system</code></a> option,
          <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a> is not built. In this case,
          the system <span class="command"><strong>openssl zlib</strong></span> command can be used
          instead.
</p>
</div>
<p>
        Invoke <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a> like this:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>zlib_decompress <em class="replaceable"><code>input_file</code></em> <em class="replaceable"><code>output_file</code></em></code></strong>
</pre><p>
        Example:
      </p><pre data-lang="terminal" class="programlisting">shell&gt; <strong class="userinput"><code>mysqlpump --compress-output=ZLIB &gt; dump.zlib</code></strong>
shell&gt; <strong class="userinput"><code>zlib_decompress dump.zlib dump.txt</code></strong>
</pre><p>
        To see a help message, invoke <a class="link" href="programs.html#zlib-decompress" title="4.8.3 zlib_decompress — Decompress mysqlpump ZLIB-Compressed Output"><span class="command"><strong>zlib_decompress</strong></span></a>
        with no arguments.
      </p><p>
        To decompress <a class="link" href="programs.html#mysqlpump" title="4.5.6 mysqlpump — A Database Backup Program"><span class="command"><strong>mysqlpump</strong></span></a> LZ4-compressed
        output, use <a class="link" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output"><span class="command"><strong>lz4_decompress</strong></span></a>. See
        <a class="xref" href="programs.html#lz4-decompress" title="4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output">Section 4.8.1, “<span class="command"><strong>lz4_decompress</strong></span> — Decompress mysqlpump LZ4-Compressed Output”</a>.
</p>
</div>

</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="environment-variables"></a>4.9 Environment Variables</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417859280"></a><a class="indexterm" name="idm46444417857792"></a><a class="indexterm" name="idm46444417856720"></a><p>
    This section lists environment variables that are used directly or
    indirectly by MySQL. Most of these can also be found in other places
    in this manual.
  </p><p>
    Options on the command line take precedence over values specified in
    option files and environment variables, and values in option files
    take precedence over values in environment variables. In many cases,
    it is preferable to use an option file instead of environment
    variables to modify the behavior of MySQL. See
    <a class="xref" href="programs.html#option-files" title="4.2.2.2 Using Option Files">Section 4.2.2.2, “Using Option Files”</a>.
</p><a class="indexterm" name="idm46444417853680"></a><a class="indexterm" name="idm46444417852576"></a><a class="indexterm" name="idm46444417851072"></a><a class="indexterm" name="idm46444417849968"></a><a class="indexterm" name="idm46444417848480"></a><a class="indexterm" name="idm46444417847392"></a><a class="indexterm" name="idm46444417845936"></a><a class="indexterm" name="idm46444417844864"></a><a class="indexterm" name="idm46444417843408"></a><a class="indexterm" name="idm46444417842320"></a><a class="indexterm" name="idm46444417840832"></a><a class="indexterm" name="idm46444417839744"></a><a class="indexterm" name="idm46444417838256"></a><a class="indexterm" name="idm46444417837168"></a><a class="indexterm" name="idm46444417835680"></a><a class="indexterm" name="idm46444417834592"></a><a class="indexterm" name="idm46444417833104"></a><a class="indexterm" name="idm46444417832000"></a><a class="indexterm" name="idm46444417830496"></a><a class="indexterm" name="idm46444417829392"></a><a class="indexterm" name="idm46444417827904"></a><a class="indexterm" name="idm46444417826816"></a><a class="indexterm" name="idm46444417825328"></a><a class="indexterm" name="idm46444417824240"></a><a class="indexterm" name="idm46444417822752"></a><a class="indexterm" name="idm46444417821664"></a><a class="indexterm" name="idm46444417820176"></a><a class="indexterm" name="idm46444417819088"></a><a class="indexterm" name="idm46444417817600"></a><a class="indexterm" name="idm46444417816512"></a><a class="indexterm" name="idm46444417815024"></a><a class="indexterm" name="idm46444417813936"></a><a class="indexterm" name="idm46444417812448"></a><a class="indexterm" name="idm46444417811360"></a><a class="indexterm" name="idm46444417809872"></a><a class="indexterm" name="idm46444417808752"></a><a class="indexterm" name="idm46444417807248"></a><a class="indexterm" name="idm46444417806128"></a><a class="indexterm" name="idm46444417804624"></a><a class="indexterm" name="idm46444417803504"></a><a class="indexterm" name="idm46444417802000"></a><a class="indexterm" name="idm46444417800912"></a><a class="indexterm" name="idm46444417799424"></a><a class="indexterm" name="idm46444417798336"></a><a class="indexterm" name="idm46444417796848"></a><a class="indexterm" name="idm46444417795760"></a><a class="indexterm" name="idm46444417794272"></a><a class="indexterm" name="idm46444417793168"></a><a class="indexterm" name="idm46444417791680"></a><a class="indexterm" name="idm46444417790576"></a><a class="indexterm" name="idm46444417789088"></a><a class="indexterm" name="idm46444417787984"></a><a class="indexterm" name="idm46444417786496"></a><a class="indexterm" name="idm46444417785408"></a><a class="indexterm" name="idm46444417783920"></a><a class="indexterm" name="idm46444417782832"></a><a class="indexterm" name="idm46444417781344"></a><a class="indexterm" name="idm46444417780256"></a><a class="indexterm" name="idm46444417778768"></a><a class="indexterm" name="idm46444417777680"></a><a class="indexterm" name="idm46444417776192"></a><a class="indexterm" name="idm46444417775104"></a><a class="indexterm" name="idm46444417773616"></a><a class="indexterm" name="idm46444417772528"></a><a class="indexterm" name="idm46444417771040"></a><a class="indexterm" name="idm46444417769952"></a><a class="indexterm" name="idm46444417768464"></a><a class="indexterm" name="idm46444417767392"></a><a class="indexterm" name="idm46444417765936"></a><a class="indexterm" name="idm46444417764848"></a><a class="indexterm" name="idm46444417763360"></a><a class="indexterm" name="idm46444417762272"></a><a class="indexterm" name="idm46444417760784"></a><a class="indexterm" name="idm46444417759696"></a>
<div class="informaltable">
<table summary="Environment variables that are used directly or indirectly by MySQL."><col width="40%"><col width="60%"><thead><tr>
        <th scope="col">Variable</th>
        <th scope="col">Description</th>
      </tr></thead><tbody><tr>
        <td scope="row"><code class="literal">AUTHENTICATION_LDAP_CLIENT_LOG</code></td>
        <td>Client-side LDAP authentication logging level.</td>
      </tr><tr>
        <td scope="row"><code class="literal">AUTHENTICATION_PAM_LOG</code></td>
        <td><a class="link" href="security.html#pam-pluggable-authentication-debugging" title="PAM Authentication Debugging">PAM</a>
          authentication plugin debug logging settings.</td>
      </tr><tr>
        <td scope="row"><code class="literal">CC</code></td>
        <td>The name of your C compiler (for running <span class="command"><strong>CMake</strong></span>).</td>
      </tr><tr>
        <td scope="row"><code class="literal">CXX</code></td>
        <td>The name of your C++ compiler (for running <span class="command"><strong>CMake</strong></span>).</td>
      </tr><tr>
        <td scope="row"><code class="literal">CC</code></td>
        <td>The name of your C compiler (for running <span class="command"><strong>CMake</strong></span>).</td>
      </tr><tr>
        <td scope="row"><code class="literal">DBI_USER</code></td>
        <td>The default user name for Perl DBI.</td>
      </tr><tr>
        <td scope="row"><code class="literal">DBI_TRACE</code></td>
        <td>Trace options for Perl DBI.</td>
      </tr><tr>
        <td scope="row"><code class="literal">HOME</code></td>
        <td>The default path for the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> history file is
          <code class="filename">$HOME/.mysql_history</code>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">LD_RUN_PATH</code></td>
        <td>Used to specify the location of <code class="filename">libmysqlclient.so</code>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN</code></td>
        <td>Enable <code class="literal">mysql_clear_password</code> authentication plugin;
          see <a class="xref" href="security.html#cleartext-pluggable-authentication" title="6.4.1.4 Client-Side Cleartext Pluggable Authentication">Section 6.4.1.4, “Client-Side Cleartext Pluggable Authentication”</a>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">LIBMYSQL_PLUGIN_DIR</code></td>
        <td>Directory in which to look for client plugins.</td>
      </tr><tr>
        <td scope="row"><code class="literal">LIBMYSQL_PLUGINS</code></td>
        <td>Client plugins to preload.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_DEBUG</code></td>
        <td>Debug trace options when debugging.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_GROUP_SUFFIX</code></td>
        <td>Option group suffix value (like specifying
          <a class="link" href="programs.html#option_general_defaults-group-suffix"><code class="option">--defaults-group-suffix</code></a>).</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_HISTFILE</code></td>
        <td>The path to the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> history file. If this variable
          is set, its value overrides the default for
          <code class="filename">$HOME/.mysql_history</code>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_HISTIGNORE</code></td>
        <td>Patterns specifying statements that <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> should not
          log to <code class="filename">$HOME/.mysql_history</code>, or
          <code class="literal">syslog</code> if
          <a class="link" href="programs.html#option_mysql_syslog"><code class="option">--syslog</code></a> is given.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_HOME</code></td>
        <td>The path to the directory in which the server-specific
          <code class="filename">my.cnf</code> file resides.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_HOST</code></td>
        <td>The default host name used by the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> command-line
          client.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_OPENSSL_UDF_DH_BITS_THRESHOLD</code></td>
        <td>Maximum key length for
          <a class="link" href="functions.html#function_create-dh-parameters"><code class="literal">CREATE_DH_PARAMETERS()</code></a>. See
          <a class="xref" href="functions.html#enterprise-encryption-usage" title="12.19.2 MySQL Enterprise Encryption Usage and Examples">Section 12.19.2, “MySQL Enterprise Encryption Usage and Examples”</a>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_OPENSSL_UDF_DSA_BITS_THRESHOLD</code></td>
        <td>Maximum DSA key length for
          <a class="link" href="functions.html#function_create-asymmetric-priv-key"><code class="literal">CREATE_ASYMMETRIC_PRIV_KEY()</code></a>.
          See <a class="xref" href="functions.html#enterprise-encryption-usage" title="12.19.2 MySQL Enterprise Encryption Usage and Examples">Section 12.19.2, “MySQL Enterprise Encryption Usage and Examples”</a>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_OPENSSL_UDF_RSA_BITS_THRESHOLD</code></td>
        <td>Maximum RSA key length for
          <a class="link" href="functions.html#function_create-asymmetric-priv-key"><code class="literal">CREATE_ASYMMETRIC_PRIV_KEY()</code></a>.
          See <a class="xref" href="functions.html#enterprise-encryption-usage" title="12.19.2 MySQL Enterprise Encryption Usage and Examples">Section 12.19.2, “MySQL Enterprise Encryption Usage and Examples”</a>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_PS1</code></td>
        <td>The command prompt to use in the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> command-line
          client.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_PWD</code></td>
        <td>The default password when connecting to <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>. Using
          this is insecure. See note following table.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_TCP_PORT</code></td>
        <td>The default TCP/IP port number.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_TEST_LOGIN_FILE</code></td>
        <td>The name of the <code class="filename">.mylogin.cnf</code> login path file.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_TEST_TRACE_CRASH</code></td>
        <td>Whether the test protocol trace plugin crashes clients. See note
          following table.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_TEST_TRACE_DEBUG</code></td>
        <td>Whether the test protocol trace plugin produces output. See note
          following table.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQL_UNIX_PORT</code></td>
        <td>The default Unix socket file name; used for connections to
          <code class="literal">localhost</code>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQLX_TCP_PORT</code></td>
        <td>The X Plugin default TCP/IP port number.</td>
      </tr><tr>
        <td scope="row"><code class="literal">MYSQLX_UNIX_PORT</code></td>
        <td>The X Plugin default Unix socket file name; used for connections to
          <code class="literal">localhost</code>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">NOTIFY_SOCKET</code></td>
        <td>Socket used by <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> to communicate with systemd.</td>
      </tr><tr>
        <td scope="row"><code class="literal">PATH</code></td>
        <td>Used by the shell to find MySQL programs.</td>
      </tr><tr>
        <td scope="row"><code class="literal">PKG_CONFIG_PATH</code></td>
        <td>Location of <code class="filename">mysqlclient.pc</code>
          <span class="command"><strong>pkg-config</strong></span> file. See note following table.</td>
      </tr><tr>
        <td scope="row"><code class="literal">TMPDIR</code></td>
        <td>The directory in which temporary files are created.</td>
      </tr><tr>
        <td scope="row"><code class="literal">TZ</code></td>
        <td>This should be set to your local time zone. See
          <a class="xref" href="error-handling.html#timezone-problems" title="B.4.3.7 Time Zone Problems">Section B.4.3.7, “Time Zone Problems”</a>.</td>
      </tr><tr>
        <td scope="row"><code class="literal">UMASK</code></td>
        <td>The user-file creation mode when creating files. See note following
          table.</td>
      </tr><tr>
        <td scope="row"><code class="literal">UMASK_DIR</code></td>
        <td>The user-directory creation mode when creating directories. See note
          following table.</td>
      </tr><tr>
        <td scope="row"><code class="literal">USER</code></td>
        <td>The default user name on Windows when connecting to
          <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>.</td>
</tr></tbody></table>
</div>
<p>
    For information about the <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> history file, see
    <a class="xref" href="programs.html#mysql-logging" title="4.5.1.3 mysql Client Logging">Section 4.5.1.3, “mysql Client Logging”</a>.
  </p><p>
    Use of <code class="literal">MYSQL_PWD</code> to specify a MySQL password must
    be considered <span class="emphasis"><em>extremely insecure</em></span> and should not
    be used. Some versions of <span class="command"><strong>ps</strong></span> include an option to
    display the environment of running processes. On some systems, if
    you set <code class="literal">MYSQL_PWD</code>, your password is exposed to
    any other user who runs <span class="command"><strong>ps</strong></span>. Even on systems
    without such a version of <span class="command"><strong>ps</strong></span>, it is unwise to
    assume that there are no other methods by which users can examine
    process environments.
  </p><p>
    <code class="literal">MYSQL_PWD</code> is deprecated as of MySQL
    8.0 and will be removed in a future MySQL version.
  </p><p>
    <code class="literal">MYSQL_TEST_LOGIN_FILE</code> is the path name of the
    login path file (the file created by
    <a class="link" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility"><span class="command"><strong>mysql_config_editor</strong></span></a>). If not set, the default
    value is <code class="filename">%APPDATA%\MySQL\.mylogin.cnf</code> directory
    on Windows and <code class="filename">$HOME/.mylogin.cnf</code> on
    non-Windows systems. See <a class="xref" href="programs.html#mysql-config-editor" title="4.6.7 mysql_config_editor — MySQL Configuration Utility">Section 4.6.7, “<span class="command"><strong>mysql_config_editor</strong></span> — MySQL Configuration Utility”</a>.
  </p><p>
    The <code class="literal">MYSQL_TEST_TRACE_DEBUG</code> and
    <code class="literal">MYSQL_TEST_TRACE_CRASH</code> variables control the test
    protocol trace client plugin, if MySQL is built with that plugin
    enabled. For more information, see
    <a class="xref" href="extending-mysql.html#test-protocol-trace-plugin" title="29.2.4.11.1 Using the Test Protocol Trace Plugin">Section 29.2.4.11.1, “Using the Test Protocol Trace Plugin”</a>.
  </p><p>
    The default <code class="literal">UMASK</code> and
    <code class="literal">UMASK_DIR</code> values are <code class="literal">0640</code> and
    <code class="literal">0750</code>, respectively. MySQL assumes that the value
    for <code class="literal">UMASK</code> or <code class="literal">UMASK_DIR</code> is in
    octal if it starts with a zero. For example, setting
    <code class="literal">UMASK=0600</code> is equivalent to
    <code class="literal">UMASK=384</code> because 0600 octal is 384 decimal.
  </p><p>
    The <code class="literal">UMASK</code> and <code class="literal">UMASK_DIR</code>
    variables, despite their names, are used as modes, not masks:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
        If <code class="literal">UMASK</code> is set, <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a>
        uses <code class="literal">($UMASK | 0600)</code> as the mode for file
        creation, so that newly created files have a mode in the range
        from 0600 to 0666 (all values octal).
      </p></li><li class="listitem"><p>
        If <code class="literal">UMASK_DIR</code> is set,
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> uses <code class="literal">($UMASK_DIR |
        0700)</code> as the base mode for directory creation, which
        then is AND-ed with <code class="literal">~(~$UMASK &amp; 0666)</code>, so
        that newly created directories have a mode in the range from
        0700 to 0777 (all values octal). The AND operation may remove
        read and write permissions from the directory mode, but not
        execute permissions.
</p></li></ul>
</div>
<p>
    See also <a class="xref" href="error-handling.html#file-permissions" title="B.4.3.1 Problems with File Permissions">Section B.4.3.1, “Problems with File Permissions”</a>.
  </p><p>
    It may be necessary to set <code class="literal">PKG_CONFIG_PATH</code> if you
    use <span class="command"><strong>pkg-config</strong></span> for building MySQL programs. See
    <a class="xref" href="connectors-apis.html#c-api-building-clients-pkg-config" title="28.7.3.2 Building C API Client Programs Using pkg-config">Section 28.7.3.2, “Building C API Client Programs Using pkg-config”</a>.
</p>
</div>
<div class="section">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a name="unix-signal-response"></a>4.10 Unix Signal Handling in MySQL</h2>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417575968"></a><a class="indexterm" name="idm46444417574928"></a><p>
      On Unix and Unix-like systems, a process can be the recipient of
      signals sent to it by <code class="literal">root</code> or the account that
      owns the process. Signals can be sent using the
      <a class="link" href="sql-statements.html#kill" title="13.7.8.4 KILL Statement"><span class="command"><strong>kill</strong></span></a> command. Some command interpreters
      associate certain key sequences with signals, such as
      <span class="keycap"><strong>Control+C</strong></span> to send a <code class="literal">SIGINT</code>
      signal. This section describes how the MySQL server and client
      programs respond to signals.
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><a class="xref" href="programs.html#server-signal-response" title="Server Response to Signals">Server Response to Signals</a></p></li><li class="listitem"><p><a class="xref" href="programs.html#client-signal-response" title="Client Response to Signals">Client Response to Signals</a></p></li></ul>
</div>

<div class="simplesect">

<div class="titlepage">
<div>

<div class="simple">
<h3 class="title"><a name="server-signal-response"></a>Server Response to Signals</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417566176"></a><a class="indexterm" name="idm46444417564720"></a><a class="indexterm" name="idm46444417563232"></a><a class="indexterm" name="idm46444417561744"></a><a class="indexterm" name="idm46444417560256"></a><a class="indexterm" name="idm46444417558768"></a><p>
        <a class="link" href="programs.html#mysqld" title="4.3.1 mysqld — The MySQL Server"><span class="command"><strong>mysqld</strong></span></a> responds to signals as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            <code class="literal">SIGTERM</code> causes the server to shut down.
            This is like executing a
            <a class="link" href="sql-statements.html#shutdown" title="13.7.8.9 SHUTDOWN Statement"><code class="literal">SHUTDOWN</code></a> statement without
            having to connect to the server (which for shutdown requires
            an account that has the
            <a class="link" href="security.html#priv_shutdown"><code class="literal">SHUTDOWN</code></a> privilege).
          </p></li><li class="listitem"><p>
            <code class="literal">SIGHUP</code> causes the server to reload the
            grant tables and to flush tables, logs, the thread cache,
            and the host cache. These actions are like various forms of
            the <a class="link" href="sql-statements.html#flush" title="13.7.8.3 FLUSH Statement"><code class="literal">FLUSH</code></a> statement. Prior to
            MySQL 8.0.20, the server also writes a status report to the
            error log that has this format:
          </p><pre data-lang="simple" class="programlisting">Status information:

Current dir: /var/mysql/data/
Running threads: 0  Stack size: 196608
Current locks:

Key caches:
default
Buffer_size:       8388600
Block_size:           1024
Division_limit:        100
Age_limit:             300
blocks used:             0
not flushed:             0
w_requests:              0
writes:                  0
r_requests:              0
reads:                   0

handler status:
read_key:            0
read_next:           0
read_rnd             0
read_first:          1
write:               0
delete               0
update:              0

Table status:
Opened tables:          5
Open tables:            0
Open files:             7
Open streams:           0

Alarm status:
Active alarms:   1
Max used alarms: 2
Next alarm time: 67</pre></li><li class="listitem"><p>
            As of MySQL 8.0.19, <code class="literal">SIGUSR1</code> causes the
            server to flush the error log, general query log, and slow
            query log. One use for <code class="literal">SIGUSR1</code> is to
            implement log rotation without having to connect to the
            server (which to flush logs requires an account that has the
            <a class="link" href="security.html#priv_reload"><code class="literal">RELOAD</code></a> privilege). See
            <a class="xref" href="server-administration.html#log-file-maintenance" title="5.4.6 Server Log Maintenance">Section 5.4.6, “Server Log Maintenance”</a>.
          </p><p>
            The server response to <code class="literal">SIGUSR1</code> is a
            subset of the response to <code class="literal">SIGHUP</code>,
            enabling <code class="literal">SIGUSR1</code> to be used as a more
            <span class="quote">“<span class="quote">lightweight</span>”</span> signal that flushes certain logs
            without the other <code class="literal">SIGHUP</code> effects such as
            flushing the thread and host caches and writing a status
            report to the error log.
          </p></li><li class="listitem"><p>
            <code class="literal">SIGINT</code> normally is ignored by the server.
            Starting the server with the
            <a class="link" href="server-administration.html#option_mysqld_gdb"><code class="option">--gdb</code></a> option installs an
            interrupt handler for <code class="literal">SIGINT</code> for
            debugging purposes. See
            <a class="xref" href="extending-mysql.html#using-gdb-on-mysqld" title="29.5.1.4 Debugging mysqld under gdb">Section 29.5.1.4, “Debugging mysqld under gdb”</a>.
</p></li></ul>
</div>

</div>
<div class="simplesect">
<div class="titlepage">
<div>
<div class="simple">
<h3 class="title"><a name="client-signal-response"></a>Client Response to Signals</h3>

</div>

</div>

</div>
<a class="indexterm" name="idm46444417532928"></a><a class="indexterm" name="idm46444417531472"></a><a class="indexterm" name="idm46444417529984"></a><a class="indexterm" name="idm46444417528496"></a><p>
        MySQL client programs respond to signals as follows:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
            The <a class="link" href="programs.html#mysql" title="4.5.1 mysql — The MySQL Command-Line Client"><span class="command"><strong>mysql</strong></span></a> client interprets
            <code class="literal">SIGINT</code> (typically the result of typing
            <span class="keycap"><strong>Control+C</strong></span>) as instruction to interrupt the
            current statement if there is one, or to cancel any partial
            input line otherwise. This behavior can be disabled using
            the <a class="link" href="programs.html#option_mysql_sigint-ignore"><code class="option">--sigint-ignore</code></a> option to
            ignore <code class="literal">SIGINT</code> signals.
          </p></li><li class="listitem"><p>
            Client programs that use the MySQL client library block
            <code class="literal">SIGPIPE</code> signals by default. These
            variations are possible:
</p>
<div class="itemizedlist">
<ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>
                Client can install their own <code class="literal">SIGPIPE</code>
                handler to override the default behavior. See
                <a class="xref" href="connectors-apis.html#c-api-threaded-clients" title="28.7.3.3 Writing C API Threaded Client Programs">Section 28.7.3.3, “Writing C API Threaded Client Programs”</a>.
              </p></li><li class="listitem"><p>
                Clients can prevent installation of
                <code class="literal">SIGPIPE</code> handlers by specifying the
                <code class="literal">CLIENT_IGNORE_SIGPIPE</code> option to
                <a class="link" href="connectors-apis.html#mysql-real-connect" title="28.7.6.54 mysql_real_connect()"><code class="literal">mysql_real_connect()</code></a> at
                connect time. See <a class="xref" href="connectors-apis.html#mysql-real-connect" title="28.7.6.54 mysql_real_connect()">Section 28.7.6.54, “mysql_real_connect()”</a>.
</p></li></ul>
</div>
</li></ul>
</div>

</div>

</div>

</div>
<div class="copyright-footer">

</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="tutorial.html">Prev</a></td>
<td width="20%" align="center"><a accesskey="u" href="">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="server-administration.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Chapter 3 Tutorial</td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top">Chapter 5 MySQL Server Administration</td>
</tr>
</table>
</div>
</body>
</html>
